9.1 电子评标室统一路由和模块
This commit is contained in:
@ -2,24 +2,24 @@ import React, { useState, useRef } from 'react';
|
||||
import { message, PageHeader, Button, Spin } from 'antd';
|
||||
import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
|
||||
import { getPage, handleAlarm } from './service';
|
||||
import ViewEvalAlarmUpdateModal from '../Evaluation/BidControl/BidControlManager/components/ViewEvalAlarmUpdateModal';
|
||||
import ViewEvalAlarmUpdateModal from '../../Evaluation/BidControl/BidControlManager/components/ViewEvalAlarmUpdateModal';
|
||||
|
||||
|
||||
interface alarmData {
|
||||
tilte:string;//标题
|
||||
id:string;//告警id
|
||||
reserveId:string;//预约id
|
||||
tpName:string;//项目名称
|
||||
tpNumber:string;//项目编号
|
||||
bsName:string;//标段名称
|
||||
placeName:string; //评标室名称
|
||||
startDate:string; //开始时间
|
||||
endDate:string; //结束时间
|
||||
status:string;//处理状态:0未处理;1已处理',
|
||||
roomStatus:string;//评标室状态 0-未开启 1-进行中 2-已结束
|
||||
pNumber:string;//人数信息
|
||||
remark:string;//处理说明
|
||||
attachment:string;//附件id
|
||||
tilte: string;//标题
|
||||
id: string;//告警id
|
||||
reserveId: string;//预约id
|
||||
tpName: string;//项目名称
|
||||
tpNumber: string;//项目编号
|
||||
bsName: string;//标段名称
|
||||
placeName: string; //评标室名称
|
||||
startDate: string; //开始时间
|
||||
endDate: string; //结束时间
|
||||
status: string;//处理状态:0未处理;1已处理',
|
||||
roomStatus: string;//评标室状态 0-未开启 1-进行中 2-已结束
|
||||
pNumber: string;//人数信息
|
||||
remark: string;//处理说明
|
||||
attachment: string;//附件id
|
||||
}
|
||||
|
||||
const AbnormalAalarm: React.FC<{}> = () => {
|
||||
@ -34,7 +34,7 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
pageSize: 10
|
||||
});
|
||||
|
||||
const alarm:alarmData ={
|
||||
const alarm: alarmData = {
|
||||
tilte: "测试",
|
||||
id: '',
|
||||
reserveId: '',
|
||||
@ -54,25 +54,26 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
//委托列表
|
||||
const columns: ProColumns<any>[] = [
|
||||
{
|
||||
title: '序号', valueType: 'index', width: 50, hideInSearch:true, align: 'center'
|
||||
title: '序号', valueType: 'index', width: 50, hideInSearch: true, align: 'center'
|
||||
},
|
||||
{ title: '项目名称', dataIndex: 'projectName', width: '15%', hideInSearch: false, align: 'center' },
|
||||
{ title: '标段名称', dataIndex: 'sectionName', hideInSearch: false, align: 'center' },
|
||||
{ title: '评审室名称', dataIndex: 'areaName', width: '10%',hideInSearch:true, align: 'center' },
|
||||
{ title: '告警设备类型', dataIndex: 'deviceType', hideInSearch:true, align: 'center' },
|
||||
{ title: '告警设备编号', dataIndex: 'deviceCode', width: '15%', hideInSearch:true, align: 'center'},
|
||||
{ title: '告警消息', dataIndex: 'type', hideInSearch: false, align: 'center',
|
||||
{ title: '评审室名称', dataIndex: 'areaName', width: '10%', hideInSearch: true, align: 'center' },
|
||||
{ title: '告警设备类型', dataIndex: 'deviceType', hideInSearch: true, align: 'center' },
|
||||
{ title: '告警设备编号', dataIndex: 'deviceCode', width: '15%', hideInSearch: true, align: 'center' },
|
||||
{
|
||||
title: '告警消息', dataIndex: 'type', hideInSearch: false, align: 'center',
|
||||
valueEnum: {
|
||||
1: { text: '设备离线'},
|
||||
2: { text: '人员数量异常'},
|
||||
3: { text: '陌生人告警'},
|
||||
1: { text: '设备离线' },
|
||||
2: { text: '人员数量异常' },
|
||||
3: { text: '陌生人告警' },
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '处理状态', dataIndex: 'status', align: 'center',hideInSearch: true,
|
||||
title: '处理状态', dataIndex: 'status', align: 'center', hideInSearch: true,
|
||||
valueEnum: {
|
||||
0: { text: '未处理'},
|
||||
1: { text: '已处理'},
|
||||
0: { text: '未处理' },
|
||||
1: { text: '已处理' },
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -80,13 +81,13 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
valueType: 'option',
|
||||
render: (_, record) => {
|
||||
if (record.type === "1") {
|
||||
if(record.status === "0"){
|
||||
if (record.status === "0") {
|
||||
return <Button type="text" onClick={() => { handle(record); }}>处理</Button>
|
||||
}
|
||||
} else {
|
||||
return (<Button type='text' onClick={() => { EnvData(record); setViewDetailModalVisible(true); }}>查看详情</Button>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
];
|
||||
@ -111,7 +112,7 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
hide();
|
||||
message.error('处理失败请重试!');
|
||||
return false;
|
||||
}finally{
|
||||
} finally {
|
||||
setSpin(false);
|
||||
}
|
||||
};
|
||||
@ -120,30 +121,30 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
* @param record 列表数据
|
||||
*/
|
||||
const EnvData = (record: any) => {
|
||||
alarm.tilte=getTypeValue(record.type);
|
||||
alarm.tpName=record.projectName;
|
||||
alarm.tpNumber=record.projectNum;
|
||||
alarm.bsName=record.sectionName;
|
||||
alarm.id=record.id;
|
||||
alarm.reserveId=record.reserveId;
|
||||
alarm.placeName=record.areaName;
|
||||
alarm.startDate=record.startDate;
|
||||
alarm.endDate=record.endDate;
|
||||
alarm.pNumber=record.pnumber;
|
||||
alarm.status=record.status;
|
||||
alarm.roomStatus=record.roomStatus;
|
||||
alarm.remark=record.remark;
|
||||
alarm.attachment=record.attachment;
|
||||
alarm.tilte = getTypeValue(record.type);
|
||||
alarm.tpName = record.projectName;
|
||||
alarm.tpNumber = record.projectNum;
|
||||
alarm.bsName = record.sectionName;
|
||||
alarm.id = record.id;
|
||||
alarm.reserveId = record.reserveId;
|
||||
alarm.placeName = record.areaName;
|
||||
alarm.startDate = record.startDate;
|
||||
alarm.endDate = record.endDate;
|
||||
alarm.pNumber = record.pnumber;
|
||||
alarm.status = record.status;
|
||||
alarm.roomStatus = record.roomStatus;
|
||||
alarm.remark = record.remark;
|
||||
alarm.attachment = record.attachment;
|
||||
setAlarmData(alarm);
|
||||
}
|
||||
|
||||
function getTypeValue(key:any){
|
||||
function getTypeValue(key: any) {
|
||||
let val = "";
|
||||
if (key === "2") {
|
||||
val = "人员数量异常";
|
||||
}else if(key === "3"){
|
||||
} else if (key === "3") {
|
||||
val = "陌生人告警";
|
||||
}else{
|
||||
} else {
|
||||
val = key;
|
||||
}
|
||||
return val;
|
||||
@ -187,12 +188,12 @@ const AbnormalAalarm: React.FC<{}> = () => {
|
||||
/>
|
||||
</div>
|
||||
{viewDetailModalVisible ? (
|
||||
<ViewEvalAlarmUpdateModal
|
||||
<ViewEvalAlarmUpdateModal
|
||||
alarmData={alarmData}
|
||||
detail={viewDetailModalVisible}
|
||||
isLookType={true}
|
||||
onCancel={() => setViewDetailModalVisible(false)}
|
||||
onOk={()=>{}}
|
||||
onOk={() => { }}
|
||||
>
|
||||
</ViewEvalAlarmUpdateModal>
|
||||
) : null
|
@ -192,7 +192,7 @@ export default () => {
|
||||
}
|
||||
//查看预约详情跳转
|
||||
const viewMeetContent = () => {
|
||||
window.open("/ElecEvalReserve");
|
||||
window.open("/ElecEvaluation/ElecEvalReserve");
|
||||
}
|
||||
|
||||
useEffect(() => {
|
@ -113,7 +113,7 @@ export const LocalTime = () => {
|
||||
}
|
||||
|
||||
const projectClick = () => {
|
||||
history.push("/MonitorScreen/MonitorRoom");
|
||||
history.push("/ElecMonitorScreen/MonitorRoom");
|
||||
}
|
||||
const GraphChart = (props: { type: string, chartData: any[] }) => {
|
||||
const { type, chartData } = props;
|
@ -149,7 +149,7 @@ const itemRender: PaginationProps['itemRender'] = (_, type, originalElement) =>
|
||||
return originalElement;
|
||||
};
|
||||
export const homeClick = () => {
|
||||
history.push("/MonitorScreen/Home");
|
||||
history.push("/ElecMonitorScreen/Home");
|
||||
}
|
||||
export const previousClick = () => {
|
||||
history.goBack();
|
||||
@ -210,7 +210,7 @@ export default () => {
|
||||
return;
|
||||
}
|
||||
history.push({
|
||||
pathname: "/MonitorScreen/ProjectMonitorRoom",
|
||||
pathname: "/ElecMonitorScreen/ProjectMonitorRoom",
|
||||
state: { monitorId: item.id },
|
||||
})
|
||||
}
|
@ -32,7 +32,7 @@ const OnlineSupervision: React.FC<{}> = () => {
|
||||
|
||||
//在线监督
|
||||
function supervision(record: any): void {
|
||||
window.open("/MonitorScreen/ProjectMonitorRoom?monitorId=" + record.id);
|
||||
window.open("/ElecMonitorScreen/ProjectMonitorRoom?monitorId=" + record.id);
|
||||
}
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
@ -168,8 +168,8 @@ const OnlineSupervision: React.FC<{}> = () => {
|
||||
}).finally(() => {
|
||||
isNotEmpty(window.location.search) && history.push(window.location.pathname);
|
||||
spinSet(false);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
pagination={{
|
||||
defaultPageSize: 10,
|
||||
@ -184,7 +184,7 @@ const OnlineSupervision: React.FC<{}> = () => {
|
||||
rowKey={"id"}
|
||||
/>
|
||||
</div>
|
||||
<ViewModal modalVisible = {visible} onCancel = {()=> closeViewDetails()} ref = {viewModalRef}/>
|
||||
<ViewModal modalVisible={visible} onCancel={() => closeViewDetails()} ref={viewModalRef} />
|
||||
</Spin>
|
||||
)
|
||||
}
|
@ -34,7 +34,7 @@ const PostSupervision: React.FC<{}> = () => {
|
||||
|
||||
//评标监控回看
|
||||
function reviewMonitor(record: any): void {
|
||||
window.open("/MonitorScreen/ProjectMonitorRoom?monitorId=" + record.id);
|
||||
window.open("/ElecMonitorScreen/ProjectMonitorRoom?monitorId=" + record.id);
|
||||
}
|
||||
|
||||
const columns: ProColumns<any>[] = [
|
||||
@ -170,8 +170,8 @@ const PostSupervision: React.FC<{}> = () => {
|
||||
}).finally(() => {
|
||||
isNotEmpty(window.location.search) && history.push(window.location.pathname);
|
||||
spinSet(false);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
pagination={{
|
||||
defaultPageSize: 10,
|
||||
@ -186,7 +186,7 @@ const PostSupervision: React.FC<{}> = () => {
|
||||
rowKey={"id"}
|
||||
/>
|
||||
</div>
|
||||
<ViewModal modalVisible = {visible} onCancel = {()=> closeViewDetails()} ref = {viewModalRef}/>
|
||||
<ViewModal modalVisible={visible} onCancel={() => closeViewDetails()} ref={viewModalRef} />
|
||||
</Spin>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user