巴林闲侠 2 years ago
parent
commit
fc2a75fa70
  1. 305
      web/client/src/layout/components/header/index.jsx
  2. 25
      web/client/src/sections/console/containers/console.jsx
  3. 2
      web/client/src/sections/install/components/memberModal.jsx
  4. 2
      web/client/src/sections/install/containers/roles.jsx
  5. 13
      web/client/src/sections/problem/components/inspection.jsx
  6. 12
      web/client/src/sections/problem/containers/dataAlarm.jsx

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

@ -6,160 +6,175 @@ import { IconTreeTriangleDown } from '@douyinfe/semi-icons';
import "./index.less"; import "./index.less";
const Header = (props) => { const Header = (props) => {
const { dispatch, history, user, actions, socket, headerItems, tochange } = props; const { dispatch, history, user, actions, socket, headerItems, tochange } = props;
let userRole = user?.pomsUserInfo?.role
let modalRole = []
if (userRole) {
let modal = []
userRole?.map(v => {
if (v == 'data_analyst') ['analysis', 'data', 'workOrder', 'means'].map(u => modal.push(u))
if (v == 'after_sale') ['problem', 'facility', 'workOrder', 'means'].map(u => modal.push(u))
if (v == 'resource_manage') ['facility', 'workOrder', 'means'].map(u => modal.push(u))
if (v == 'customer_service') ['service', 'workOrder', 'means'].map(u => modal.push(u))
})
modal.push('console')
modal = [...new Set(modal)]
modalRole = headerItems?.filter(v => modal.includes(v.itemKey))
if (userRole?.includes('SuperAdmin') || userRole?.includes('admin')) modalRole = headerItems
return ( }
<> return (
<div id="top-slider"> <>
<Nav <div id="top-slider">
mode={"horizontal"} <Nav
onClick={({ itemKey }) => { mode={"horizontal"}
if (itemKey == "logout") { onClick={({ itemKey }) => {
dispatch(actions.auth.logout(user)); if (itemKey == "logout") {
if (socket) { dispatch(actions.auth.logout(user));
socket.disconnect(); if (socket) {
} socket.disconnect();
history.push(`/signin`); }
} history.push(`/signin`);
}} }
style={{ }}
height: 48, style={{
minWidth: 520, height: 48,
background: '#1D2343', minWidth: 520,
backgroundSize: "100% 100%", background: '#1D2343',
color: "white", backgroundSize: "100% 100%",
}} color: "white",
header={{ }}
logo: ( header={{
<img logo: (
src="/assets/images/install/long_logo.png" <img
style={{ display: "inline-block", width: 200, height: 40, marginLeft: -24 }} src="/assets/images/install/long_logo.png"
/> style={{ display: "inline-block", width: 200, height: 40, marginLeft: -24 }}
), />
text: ( ),
<> text: (
<>
{/* <SplitButtonGroup style={{ marginLeft: 10 }} aria-label="项目操作按钮组"> */} {/* <SplitButtonGroup style={{ marginLeft: 10 }} aria-label="项目操作按钮组"> */}
<Button theme="solid" type="primary" style={{ width: 52, height: 24, background: '#005ABD' }}>全局</Button> <Button theme="solid" type="primary" style={{ width: 52, height: 24, background: '#005ABD' }}>全局</Button>
{/* <Dropdown onVisibleChange={(v) => { }} menu={{}} trigger="click" position="bottomRight"> */} {/* <Dropdown onVisibleChange={(v) => { }} menu={{}} trigger="click" position="bottomRight"> */}
<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> */}
</> </>
), ),
}} }}
footer={ footer={
<> <>
{headerItems.map((item, index) => { {modalRole.length > 0 ? modalRole.map((item, index) => {
if (item.hasOwnProperty('items')) { if (item.hasOwnProperty('items')) {
return ( return (
<Nav.Sub <Nav.Sub
key={index + 'a'} key={index + 'a'}
itemKey={item.itemKey} itemKey={item.itemKey}
text={item.text} text={item.text}
dropdownStyle={{ color: '#F2F3F5' }} dropdownStyle={{ color: '#F2F3F5' }}
> >
{item.hasOwnProperty('items') && item.items.map((ite, idx) => ( {item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} /> <Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))} ))}
</Nav.Sub> </Nav.Sub>
) )
} }
else { else {
return ( return (
<div key='console' style={{ display: 'inline-flex' }}> <div key='console' style={{ display: 'inline-flex' }}>
<img src="/assets/images/background/console.png" style={{ width: 24, marginRight: -10 }} /> <img src="/assets/images/background/console.png" style={{ width: 24, marginRight: -10 }} />
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} /> <Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} />
</div> </div>
) )
} }
})} }) : ""}
<Nav.Sub <Nav.Sub
itemKey={"user"} itemKey={"user"}
text={ text={
<div <div
style={{ style={{
marginLeft: -8, marginLeft: -8,
display: "inline-block", display: "inline-block",
color: "white", color: "white",
}} }}
> >
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}> <Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)} {user?.name?.substr(0, 1)}
</Avatar> </Avatar>
<div style={{ <div style={{
display: "inline-block", position: "relative", display: "inline-block", position: "relative",
top: 10, top: 10,
left: 4, left: 4,
marginRight: 4, marginRight: 4,
}} }}
> >
</div> </div>
</div> </div>
} }
> >
<div style={{ width: 133, }}> <div style={{ width: 133, }}>
<div style={{ display: "flex", alignItems: 'center', background: '#F0F5FF', padding: '8px 0px 8px 12px' }}> <div style={{ display: "flex", alignItems: 'center', background: '#F0F5FF', padding: '8px 0px 8px 12px' }}>
<Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}> <Avatar size="extra-small" color="light-blue" style={{ marginRight: 4 }}>
{user?.name?.substr(0, 1)} {user?.name?.substr(0, 1)}
</Avatar> </Avatar>
<div style={{ fontSize: 12, color: '#4A4A4A' }}> <div style={{ fontSize: 12, color: '#4A4A4A' }}>
{user.name} {user.name}
<div title={user?.department?.map(v => v.name + '、')} style={{ width: 60, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', color: '#969799', fontSize: 12 }}>{user?.department?.map(v => v.name + '、')}</div> <div title={user?.department?.map(v => v.name + '、')} style={{ width: 60, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', color: '#969799', fontSize: 12 }}>{user?.department?.map(v => v.name + '、')}</div>
</div> </div>
</div> </div>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center', height: 30, borderBottom: '1px solid #F2F3F5', cursor: "pointer" }} <div style={{ display: 'flex', alignItems: 'center', height: 30, borderBottom: '1px solid #F2F3F5', cursor: "pointer" }}
onClick={() => { onClick={() => {
history.push(`/userCenter`); history.push(`/userCenter`);
}}> }}>
<div style={{ width: 15, height: 15, marginLeft: 20 }}> <div style={{ width: 15, height: 15, marginLeft: 20 }}>
<img src="/assets/images/console/yonghu.png" alt="" style={{ width: '100%', height: '100%' }} /> <img src="/assets/images/console/yonghu.png" alt="" style={{ width: '100%', height: '100%' }} />
</div> </div>
<div style={{ color: '#646566', fontSize: 12, marginLeft: 9 }}> <div style={{ color: '#646566', fontSize: 12, marginLeft: 9 }}>
用户中心 用户中心
</div> </div>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center', height: 30, borderBottom: '1px solid #F2F3F5', cursor: "pointer" }}> <div style={{ display: 'flex', alignItems: 'center', height: 30, borderBottom: '1px solid #F2F3F5', cursor: "pointer" }}>
<div style={{ width: 15, height: 15, marginLeft: 20 }}> <div style={{ width: 15, height: 15, marginLeft: 20 }}>
<img src="/assets/images/console/suo.png" alt="" style={{ width: '100%', height: '100%' }} /> <img src="/assets/images/console/suo.png" alt="" style={{ width: '100%', height: '100%' }} />
</div> </div>
<div style={{ color: '#646566', fontSize: 12, marginLeft: 9 }}> <div style={{ color: '#646566', fontSize: 12, marginLeft: 9 }}>
安全认证 安全认证
</div> </div>
</div> </div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: 27, color: '#646566', fontSize: 12, cursor: "pointer" }} <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: 27, color: '#646566', fontSize: 12, cursor: "pointer" }}
onClick={() => { onClick={() => {
dispatch(actions.auth.logout(user)); dispatch(actions.auth.logout(user));
if (socket) { if (socket) {
socket.disconnect(); socket.disconnect();
} }
history.push(`/signin`); history.push(`/signin`);
}}> }}>
退出 退出
{/* <Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} /> */} {/* <Nav.Item itemKey={"logout"} text={"退出"} style={{ textAlign: "center" }} /> */}
</div> </div>
{/* collapseButton collapseText */} {/* collapseButton collapseText */}
</Nav.Sub> </Nav.Sub>
</> </>
} }
/> />
</div> </div>
</> </>
); );
}; };
function mapStateToProps (state) { function mapStateToProps (state) {
const { global, auth, webSocket } = state; const { global, auth, webSocket } = state;
return { return {
actions: global.actions, actions: global.actions,
user: auth.user, user: auth.user,
socket: webSocket.socket, socket: webSocket.socket,
}; };
} }
export default connect(mapStateToProps)(Header); export default connect(mapStateToProps)(Header);

25
web/client/src/sections/console/containers/console.jsx

@ -33,8 +33,7 @@ const Console = (props) => {
const [problemsList, setProblemsList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//& const [problemsList, setProblemsList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//&
useEffect(() => { useEffect(() => {
// ACTION
// dispatch(actions.example.getMembers(user.orgId))
}, []) }, [])
useEffect(() => { useEffect(() => {
newScrollbar = new PerfectScrollbar("#news", { newScrollbar = new PerfectScrollbar("#news", {
@ -91,19 +90,7 @@ const Console = (props) => {
// dispatch(actions.example.getMembers(user.orgId)) // dispatch(actions.example.getMembers(user.orgId))
}) })
// websocket 使
// useEffect(() => {
// console.log(socket)
// if (socket) {
// socket.on('TEST', function (msg) {
// console.info(msg);
// });
// return () => {
// socket.off("TEST");
// }
// }
// }, [socket])
return ( return (
<> <>
@ -112,10 +99,10 @@ const Console = (props) => {
<div style={{ margin: '4px 0px 14px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> <div style={{ margin: '4px 0px 14px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ color: '#4A4A4A', fontSize: 14 }}> <div style={{ color: '#4A4A4A', fontSize: 14 }}>
HI欢迎回来行业服务部 HI欢迎回来
</div> </div>
<div style={{ fontFamily: 'YouSheBiaoTiHei', fontSize: 20, color: '#005ABD', marginLeft: 4 }}> <div style={{ fontFamily: 'YouSheBiaoTiHei', fontSize: 20, color: '#005ABD', marginLeft: 4 }}>
刘昊然 {user?.name}
</div> </div>
</div> </div>
<div style={{ width: 25, height: 25, cursor: "pointer" }}> <div style={{ width: 25, height: 25, cursor: "pointer" }}>
@ -383,8 +370,8 @@ const Console = (props) => {
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}> <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center' }}> <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={{ 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={{ fontFamily: "YouSheBiaoTiHei", fontSize: 24, color: '#101531', marginLeft: 8 }}>BI分析模块</div>
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>MY WORK STATION</div> <div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>BI ANAL YSIS MODEL</div>
</div> </div>
<div style={{ marginRight: 25 }}> <div style={{ marginRight: 25 }}>
<img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => setSetup(true)} /> <img title='设置' src="/assets/images/problem/setup.png" style={{ width: 18, height: 18, cursor: "pointer" }} onClick={() => setSetup(true)} />
@ -529,7 +516,7 @@ function mapStateToProps (state) {
const { auth, global, members, webSocket } = state; const { auth, global, members, webSocket } = state;
return { return {
// loading: members.isRequesting, // loading: members.isRequesting,
// user: auth.user, user: auth.user,
// actions: global.actions, // actions: global.actions,
// members: members.data, // members: members.data,
// socket: webSocket.socket // socket: webSocket.socket

2
web/client/src/sections/install/components/memberModal.jsx

@ -27,7 +27,7 @@ function memberModal (props) {
{ {
label: '数据分析师', label: '数据分析师',
value: 'data_analyst', value: 'data_analyst',
text: '拥有数据分析、工单管理的权限、资料相关的权限' text: '拥有数据分析、工单、资料相关的权限'
}, { }, {
label: '售后运维', label: '售后运维',
value: 'after_sale', value: 'after_sale',

2
web/client/src/sections/install/containers/roles.jsx

@ -130,7 +130,7 @@ const Roles = (props) => {
title: ( title: (
<div style={{ display: 'flex', alignItems: 'center' }}> <div style={{ display: 'flex', alignItems: 'center' }}>
数据分析师 数据分析师
<Tooltip content={'拥有数据分析、工单管理的权限、资料相关的权限'} style={{ lineHeight: 2 }}> <Tooltip content={'拥有数据分析、工单、资料相关的权限'} style={{ lineHeight: 2 }}>
<img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} /> <img src="/assets/images/install/table_question.png" alt="" style={{ height: 14, width: 14, marginLeft: 4 }} />
</Tooltip> </Tooltip>
</div> </div>

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

@ -63,7 +63,11 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
}) })
useEffect(() => { useEffect(() => {
dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => { dispatch(problem.getAlarmLnspection({
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')
, ...checkPatrol
})).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)
@ -97,11 +101,12 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
<span style={{ width: 0, height: 20, display: "inline-block", margin: "0 8px 0 0", borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></span> <span style={{ width: 0, height: 20, display: "inline-block", margin: "0 8px 0 0", borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></span>
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span> <span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span>
<span style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>APPLY SEMI-AUTOMATIC INSPECTION</span> <span style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>APPLY SEMI-AUTOMATIC INSPECTION</span>
<div style={{ fontSize: 12, color: 'rgb(150, 151, 153)', marginLeft: 3 }}>仅保留48小时内的图片数据每日8时1417时系统巡检一次<span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>未阅共{notRead}</span></div> <div style={{ fontSize: 12, color: 'rgb(150, 151, 153)', marginLeft: 3 }}>仅保留近两天的图片数据每日8时1417时系统巡检一次<span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>未阅共{notRead}</span></div>
</div> </div>
<div style={{ flex: 1, position: 'relative' }}> <div style={{ flex: 1, position: 'relative' }}>
<Form <Form
onSubmit={(v) => { onSubmit={(v) => {
console.log(v.time)
setCheckPatrol({ setCheckPatrol({
appId: v.appId, appId: v.appId,
noted: v.noted, noted: v.noted,
@ -109,11 +114,11 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
timeStart: v.time == 'true' ? timeStart: v.time == 'true' ?
moment().startOf('day').format('YYYY-MM-DD HH:mm:ss') : moment().startOf('day').format('YYYY-MM-DD HH:mm:ss') :
v.time == 'false' ? v.time == 'false' ?
moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss') : "", moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss') : moment().day(moment().day() - 1).startOf('day').format('YYYY-MM-DD HH:mm:ss'),
timeEnd: v.time == 'true' ? timeEnd: v.time == 'true' ?
moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') : moment().endOf('day').format('YYYY-MM-DD HH:mm:ss') :
v.time == 'false' ? v.time == 'false' ?
moment().day(moment().day() - 1).endOf('day').format('YYYY-MM-DD HH:mm:ss') : "", moment().day(moment().day() - 1).endOf('day').format('YYYY-MM-DD HH:mm:ss') : moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'),
}) })
}} }}
getFormApi={(formApi) => (api.current = formApi)} getFormApi={(formApi) => (api.current = formApi)}

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

@ -163,9 +163,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
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', 'alarmType', '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', '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', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'sustainTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'type', 'cameraKindId', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'], deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'type', 'cameraKindId', 'sustainTime', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
} }
// //
const columns = { const columns = {
@ -231,7 +231,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
</div> : "" </div> : ""
} }
}, },
{ name: '测点', sort: 4.1, value: 'point', render: (_, r, index) => 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>) : "无" },
{ name: '中断类型', sort: 6, value: 'AlarmGroupUnit' }, { name: '中断类型', sort: 6, value: 'AlarmGroupUnit' },
{ name: '告警信息', sort: 5, value: 'AlarmContent' }, { name: '告警信息', sort: 5, value: 'AlarmContent' },
{ name: '常见原因', sort: 7, value: 'AlarmCodeName' }, { name: '常见原因', sort: 7, value: 'AlarmCodeName' },
@ -257,7 +257,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
{ {
name: '持续时间', sort: 19.5, value: 'sustainTime', render: (_, r, index) => { name: '持续时间', sort: 19.5, value: 'sustainTime', render: (_, r, index) => {
// console.log(r.updateTime); // console.log(r.updateTime);
let time = moment(r.updateTime).diff(moment(r.createTime), 'seconds') let time = moment(r.confirmTime || r.updateTime || moment().format("YYYY-MM-DD HH:mm:ss")).diff(moment(r.createTime), 'seconds')
// console.log(time); // console.log(time);
return time < 60 ? '< 1分钟' : time > 3600 ? Math.floor(time / 3600) + '小时' + Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' : Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' return time < 60 ? '< 1分钟' : time > 3600 ? Math.floor(time / 3600) + '小时' + Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' : Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟'
} }
@ -279,7 +279,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
return '当前' return '当前'
} }
}, },
{ name: '位置信息', sort: 11, value: 'station', render: (_, r, index) => route == 'deviceAbnormal' ? r.station : r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.position}</div>) }, { name: '位置信息', sort: 11, value: 'station', render: (_, r, index) => route == 'deviceAbnormal' ? r.station : r.station?.length > 0 ? r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.position}</div>) : "无" },
{ {
name: '设备类型', sort: 6, value: 'cameraKindId', name: '设备类型', sort: 6, value: 'cameraKindId',
}, },

Loading…
Cancel
Save