Commit f3086ef5 authored by 李成龙's avatar 李成龙

代码优化

parent 3dd53237
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"useTabs": false, "useTabs": false,
"semi": true, "semi": true,
"singleQuote": true, "singleQuote": true,
"parser": "babylon", "parser": "babel",
"trailingComma": "none", "trailingComma": "none",
"bracketSpacing": true, "bracketSpacing": true,
"jsxBracketSameLine": false, "jsxBracketSameLine": false,
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
securityBaseURI: 'http://172.16.10.72:10005/', securityBaseURI: 'http://172.16.10.72:10005/',
//基础平台 //基础平台
loginURI: 'http://172.16.10.72/', loginURI: 'http://172.16.10.72/',
//地图服务
picURI: 'http://172.16.3.121:8001/' picURI: 'http://172.16.3.121:8001/'
}, },
// websocket 地址 // websocket 地址
......
{
"result": "SUCCESS",
"dataList": [
{ "id": 0, "name": "≤5km", "value": 5000 },
{ "id": 1, "name": "≤36km", "value": 36000 },
{ "id": 2, "name": "≤60km", "value": 60000 },
{ "id": 3, "name": "≤100km", "value": 100000 }
],
"message": null,
"success": true
}
...@@ -3,14 +3,13 @@ import RootView from '../view/monitor'; ...@@ -3,14 +3,13 @@ import RootView from '../view/monitor';
import Duty from '../view/monitor/duty'; import Duty from '../view/monitor/duty';
import Situation from '../view/biz/duty/situation'; import Situation from '../view/biz/duty/situation';
import SituationDetail from '../view/biz/duty/situationDetail'; import SituationDetail from '../view/biz/duty/situationDetail';
import Regulate from '../view/monitor/regulate';
import Bills from '../view/biz/regulate/bills'; import Bills from '../view/biz/regulate/bills';
import RootBizView from './../view/biz/index'; import RootBizView from './../view/biz/index';
import EmptyPage from './../view/common/emptyPage/EmptyPage'; import EmptyPage from './../view/common/emptyPage/EmptyPage';
import SafetyTraining from './../view/monitor/safetyManage/index'; import SafetyManage from './../view/monitor/duty/safetyManage/index';
import DaliyTraining from './../view/monitor/dailyTrain/index'; import DaliyTraining from './../view/monitor/duty/dailyTrain/index';
import EquipmentMaintain from './../view/monitor/equipmentMaintain/index'; import EquipmentMaintain from './../view/monitor/duty/equipmentMaintain/index';
import SafetyInspection from './../view/monitor/safetyInspection/index'; import SafetyInspection from './../view/monitor/duty/safetyInspection/index';
import FireMaterial from './../view/strength/fireMaterial/index'; import FireMaterial from './../view/strength/fireMaterial/index';
import FireVehicle from './../view/strength/fireVehicle/index'; import FireVehicle from './../view/strength/fireVehicle/index';
import StationFireMan from './../view/strength/stationFireMan/index'; import StationFireMan from './../view/strength/stationFireMan/index';
...@@ -22,26 +21,28 @@ import EmergencyPlan from './../view/biz/emergency/plan'; ...@@ -22,26 +21,28 @@ import EmergencyPlan from './../view/biz/emergency/plan';
const Routes = { const Routes = {
main: RootView, main: RootView,
//日常值守
duty: Duty, duty: Duty,
situation: Situation, situation: Situation,
situationDetail: SituationDetail, situationDetail: SituationDetail,
regulate: Regulate, safetyInspection: SafetyInspection,
bills: Bills,
//应急指挥
emergency: Duty,
disaster: Disaster,
history: History,
plan: EmergencyPlan,
safetyTraining: SafetyTraining,
dailyTrain: DaliyTraining, dailyTrain: DaliyTraining,
equipmentMaintain: EquipmentMaintain, equipmentMaintain: EquipmentMaintain,
safetyInspection: SafetyInspection, safetyTraining: SafetyManage,
//安全监管
regulate: Duty,
bills: Bills,
fireMaterial: FireMaterial, fireMaterial: FireMaterial,
fireVehicle: FireVehicle, fireVehicle: FireVehicle,
stationFireMan: StationFireMan, stationFireMan: StationFireMan,
stationFireTeam: StationFireTeam, stationFireTeam: StationFireTeam,
stationDuty: StationDuty stationDuty: StationDuty,
//应急指挥
emergency: Duty,
disaster: Disaster,
history: History,
plan: EmergencyPlan
}; };
export const businessRouts = [ export const businessRouts = [
......
import { commonGet } from '../utils/request';
const mockFetch = (jsonUrl) => {
return commonGet(jsonUrl);
};
export const mockService = function() {
return mockFetch('/src/_mock/mock.json');
};
...@@ -10,34 +10,20 @@ import PropTypes from 'prop-types'; ...@@ -10,34 +10,20 @@ import PropTypes from 'prop-types';
class Bills extends Component { class Bills extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {};
};
}
componentWillMount() {
} }
componentDidMount() { componentWillMount() {}
} componentDidMount() {}
componentWillUnmount() {
} componentWillUnmount() {}
render() { render() {
return ( return <div className="class-bills">单据管理</div>;
<div className="class-bills">
单据管理
</div>
);
} }
} }
Bills.propTypes = { Bills.propTypes = {};
};
export default Bills; export default Bills;
import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts';
import { Table } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd';
import moment from 'moment';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option;
const Search = Input.Search;
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '训练科目',
width: '15%',
dataIndex: 'xlkm',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '训练内容',
width: '15%',
dataIndex: 'xlnr',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '训练时间',
width: '20%',
dataIndex: 'xlsj',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '参加人数',
width: '10%',
dataIndex: 'cjrs',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '达标条件',
width: '20%',
dataIndex: 'dbtj',
render: val => <span style={{color:"green"}}>{val}</span>,
},
{
title: '达标率%',
width: '20%',
dataIndex: 'dbl',
render: val => <span style={{color:"white"}}>{val}</span>,
}
];
const data = [
{
key: '1',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '2',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '3',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '4',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '5',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '6',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '7',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '8',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '9',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '10',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '11',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '12',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '13',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '14',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '15',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '16',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '17',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '18',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '19',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '20',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '21',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '22',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '23',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '225',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '25',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '26',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '27',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '28',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
},
{
key: '29',
xlkm: '消防技能培训',
xlnr: "1500米长跑",
xlsj:'2019-01-01',
cjrs: 4,
dbtj:'队列整齐',
dbl:"60%"
}
];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/**
* 日常训练右侧
*/
class DailyTrainRight extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 10
};
this.state = {
data: [],
loading: false,
equimentId:null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList:[],
totalCount:0,
searchParam:'',
fname:'',
current: 1,
pageSize: 10,
total: 0,
tableHeight:450
};
}
componentDidMount() {
}
onEdit = (id) => {
// this.type = 'edit';
// electricFireDetailsAction(id).then(d => {
// this.setState({
// form: d,
// title: d.name
// })
// })
console.log("id:" + id)
this.setState({
data:data,
totalCount:data.length
})
}
onChange = (value, item) =>{
console.log(value, item);
}
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
}
onOk=(value) =>{
console.log('onOk: ', value);
}
onChangeSelect = (value, item) =>{
console.log(value, item);
}
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () =>{
// this.setState({
// data:data
// })
}
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData =()=>{
let name = this.state.fname;
alert(name)
}
onChange = (e,value) =>{
this.setState({ fname: value });
}
getPanelHeight = () => {
// //计算表格高度
// var box1=document.getElementById("dailyTrain-bottom-right");
// if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
// return box1.offsetHeight * 0.91;
// }
return 300
};
SearchChange = (value) => {
alert(value)
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
render() {
let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state;
return (
<div className="dailyTrain-bottom-right" id="dailyTrain-bottom-right">
<div className="dailyTrain-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
/>
</div>
</div>
</div>
);
}
}
DailyTrainRight.propTypes = {
};
export default DailyTrainRight;
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import { Select } from 'amos-framework';
import { Table } from 'amos-antd'; import { Input } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd'; import { DatePicker } from 'amos-antd';
import moment from 'moment'; import AmosGridTable from './../safetyManage/AmosGridTable';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option; const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
...@@ -23,44 +13,43 @@ const columns = [ ...@@ -23,44 +13,43 @@ const columns = [
dataIndex: 'key', dataIndex: 'key',
width: '10%', width: '10%',
align: 'center', // 设置文本居中的属性 align: 'center', // 设置文本居中的属性
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '换流站名称', title: '换流站名称',
width: '20%', width: '20%',
dataIndex: 'name', dataIndex: 'name',
render: val => <span style={{color:"yellow"}}>{val}</span>, render: val => <span style={{ color: 'yellow' }}>{val}</span>
}, },
{ {
title: '科目数', title: '科目数',
width: '10%', width: '10%',
dataIndex: 'kemu', dataIndex: 'kemu',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '次数', title: '次数',
width: '10%', width: '10%',
dataIndex: 'cishu', dataIndex: 'cishu',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '参加人员', title: '参加人员',
width: '10%', width: '10%',
dataIndex: 'cjry', dataIndex: 'cjry',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '人员达标率', title: '人员达标率',
width: '20%', width: '20%',
dataIndex: 'rydbl', dataIndex: 'rydbl',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '最近培训时间', title: '最近培训时间',
width: '20%', width: '20%',
dataIndex: 'date', dataIndex: 'date',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
} }
]; ];
const data = [ const data = [
...@@ -68,267 +57,266 @@ const data = [ ...@@ -68,267 +57,266 @@ const data = [
key: '1', key: '1',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '2', key: '2',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '3', key: '3',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '4', key: '4',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '5', key: '5',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '6', key: '6',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '7', key: '7',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '8', key: '8',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '9', key: '9',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '10', key: '10',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '11', key: '11',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '12', key: '12',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '13', key: '13',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '14', key: '14',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '15', key: '15',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '16', key: '16',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '17', key: '17',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '18', key: '18',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '19', key: '19',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '20', key: '20',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '21', key: '21',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '22', key: '22',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '23', key: '23',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '225', key: '225',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '25', key: '25',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '26', key: '26',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '27', key: '27',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '28', key: '28',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '29', key: '29',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
} }
]; ];
const selectdata = [ const selectdata = [
{ id: 0, name: '消防理论知识培训' }, { id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' }, { id: 1, name: '消防技能培训' },
...@@ -338,18 +326,12 @@ const selectdata = [ ...@@ -338,18 +326,12 @@ const selectdata = [
{ id: 4, name: '火灾隐患管理' }, { id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' } { id: 5, name: '用火用电管理' }
]; ];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/** /**
* 日常训练左侧 * 日常训练左侧
*/ */
class DailyTrainyLeft extends Component { class DailyTrainyLeft extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.pageConfig = { this.pageConfig = {
...@@ -359,65 +341,54 @@ class DailyTrainyLeft extends Component { ...@@ -359,65 +341,54 @@ class DailyTrainyLeft extends Component {
this.state = { this.state = {
data: [], data: [],
loading: false, loading: false,
equimentId:null, equimentId: null,
pagination: true, pagination: true,
isChecked: false, isChecked: false,
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
dataList: [], dataList: [],
newDataList:[], newDataList: [],
totalCount:0, totalCount: 0,
searchParam:'', searchParam: '',
fname:'', fname: '',
current: 1, current: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
tableHeight:450 tableHeight: 450
}; };
} }
componentDidMount() { componentDidMount() {}
}
onRequestTable = (callback) => {
onRequestTable = callback => {
this.setState({ this.setState({
data:data, data: data,
totalCount:data.length totalCount: data.length
}); });
callback && callback(data); callback && callback(data);
// electricFireListAction(current, pageSize, searchName).then(d => { // electricFireListAction(current, pageSize, searchName).then(d => {
// const { dataList, total } = d || {}; // const { dataList, total } = d || {};
// }); // });
} };
onChange = (value, item) =>{ onChange = (value, item) => {
console.log(value, item); console.log(value, item);
};
} onTimeChange = (value, dateString) => {
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value); console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString); console.log('Formatted Selected Time: ', dateString);
} };
onOk=(value) =>{ onOk = value => {
console.log('onOk: ', value); console.log('onOk: ', value);
} };
onChangeSelect = (value, item) =>{
onChangeSelect = (value, item) => {
console.log(value, item); console.log(value, item);
};
}
reload = r => { reload = r => {
this.setState( this.setState(
...@@ -431,12 +402,11 @@ class DailyTrainyLeft extends Component { ...@@ -431,12 +402,11 @@ class DailyTrainyLeft extends Component {
); );
}; };
getAcitonData = () => {
getAcitonData = () =>{
this.setState({ this.setState({
data:data data: data
}) });
} };
/** /**
* 分页设置参数 * 分页设置参数
...@@ -458,42 +428,38 @@ class DailyTrainyLeft extends Component { ...@@ -458,42 +428,38 @@ class DailyTrainyLeft extends Component {
// callBack(selectedRowKeys,riskSourceId,equipmentId); // callBack(selectedRowKeys,riskSourceId,equipmentId);
}; };
searchData =()=>{ searchData = () => {
let name = this.state.fname; let name = this.state.fname;
alert(name) alert(name);
} };
onChange = (e,value) =>{
onChange = (e, value) => {
this.setState({ fname: value }); this.setState({ fname: value });
} };
getPanelHeight = () => { getPanelHeight = () => {
//计算表格高度 //计算表格高度
var box1=document.getElementById("dailyTrain-bottom-left"); var box1 = document.getElementById('dailyTrain-bottom-left');
if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取 if (box1) {
return box1.offsetHeight * 0.91 //此处在加一层判断,更加严密,如果box存在的情况下获取
return box1.offsetHeight * 0.91;
} }
}; };
SearchChange = (value) => { SearchChange = value => {
alert(value) alert(value);
} };
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() { render() {
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state; const { current, pageSize, total } = this.state;
const {onEditClick} =this.props; const { onEditClick } = this.props;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state; let { pagination, isChecked, fname, data, totalCount, selectedRowKeys } = this.state;
return ( return (
<div className="dailyTrain-bottom-left" id="dailyTrain-bottom-left"> <div className="dailyTrain-bottom-left" id="dailyTrain-bottom-left">
<div className="dailyTrain-bottom-left-content"> <div className="dailyTrain-bottom-left-content">
...@@ -503,46 +469,25 @@ rowClassName = (record, index) => { ...@@ -503,46 +469,25 @@ rowClassName = (record, index) => {
<div className="search-one-input"> <div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
<div className="search-two" > <div className="search-two">
<Select
className="search-select-style"
<Select className="search-select-style"
data={selectdata} data={selectdata}
renderOption={item => <Option value={item.id}>{item.name}</Option>} renderOption={item => <Option value={item.id}>{item.name}</Option>}
defaultOption={<Option>请选择</Option>} defaultOption={<Option>请选择</Option>}
onChange={this.onChangeSelect} onChange={this.onChangeSelect}
/> />
</div> </div>
<div className="search-three"> <div className="search-three">
<span className="three-font">日期:&nbsp;&nbsp;</span> <span className="three-font">日期:&nbsp;&nbsp;</span>
<DatePicker <DatePicker placeholder="年-月-日" showTime onChange={this.onTimeChange} style={{ width: '37%' }} onOk={this.onOk} />
placeholder="年-月-日"
showTime
onChange={this.onTimeChange}
style={{width:'37%'}}
onOk={this.onOk} />
{/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */} {/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */}
&nbsp;&nbsp;<font style={{color:'#5FFFFD'}}></font>&nbsp;&nbsp; &nbsp;&nbsp;<font style={{ color: '#5FFFFD' }}></font>&nbsp;&nbsp;
<DatePicker <DatePicker placeholder="年-月-日" showTime onChange={this.onTimeChange} style={{ width: '37%' }} onOk={this.onOk} />
placeholder="年-月-日"
showTime
onChange={this.onTimeChange}
style={{width:'37%'}}
onOk={this.onOk} />
</div> </div>
</div> </div>
<div className="two-div"> <div className="two-div">
<AmosGridTable <AmosGridTable
columns={columns} columns={columns}
dataList={data} dataList={data}
...@@ -557,24 +502,15 @@ rowClassName = (record, index) => { ...@@ -557,24 +502,15 @@ rowClassName = (record, index) => {
defaultPageConfig={defaultPageConfig} defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight} getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName} rowClassName={this.rowClassName}
onRowClick={(record) => onEditClick(record)} onRowClick={record => onEditClick(record)}
/> />
</div> </div>
</div> </div>
</div> </div>
); );
} }
} }
DailyTrainyLeft.propTypes = {};
DailyTrainyLeft.propTypes = {
};
export default DailyTrainyLeft; export default DailyTrainyLeft;
import React, { Component } from 'react';
import AmosGridTable from './../safetyManage/AmosGridTable';
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '训练科目',
width: '15%',
dataIndex: 'xlkm',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '训练内容',
width: '15%',
dataIndex: 'xlnr',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '训练时间',
width: '20%',
dataIndex: 'xlsj',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '参加人数',
width: '10%',
dataIndex: 'cjrs',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '达标条件',
width: '20%',
dataIndex: 'dbtj',
render: val => <span style={{ color: 'green' }}>{val}</span>
},
{
title: '达标率%',
width: '20%',
dataIndex: 'dbl',
render: val => <span style={{ color: 'white' }}>{val}</span>
}
];
const data = [
{
key: '1',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '2',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '3',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '4',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '5',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '6',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '7',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '8',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '9',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '10',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '11',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '12',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '13',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '14',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '15',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '16',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '17',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '18',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '19',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '20',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '21',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '22',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '23',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '225',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '25',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '26',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '27',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '28',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
},
{
key: '29',
xlkm: '消防技能培训',
xlnr: '1500米长跑',
xlsj: '2019-01-01',
cjrs: 4,
dbtj: '队列整齐',
dbl: '60%'
}
];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
/**
* 日常训练右侧
*/
class DailyTrainRight extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 10
};
this.state = {
data: [],
loading: false,
equimentId: null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList: [],
totalCount: 0,
searchParam: '',
fname: '',
current: 1,
pageSize: 10,
total: 0,
tableHeight: 450
};
}
componentDidMount() {}
onEdit = id => {
// this.type = 'edit';
// electricFireDetailsAction(id).then(d => {
// this.setState({
// form: d,
// title: d.name
// })
// })
console.log('id:' + id);
this.setState({
data: data,
totalCount: data.length
});
};
onChange = (value, item) => {
console.log(value, item);
};
onTimeChange = (value, dateString) => {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
};
onOk = value => {
console.log('onOk: ', value);
};
onChangeSelect = (value, item) => {
console.log(value, item);
};
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () => {
// this.setState({
// data:data
// })
};
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData = () => {
let name = this.state.fname;
alert(name);
};
onChange = (e, value) => {
this.setState({ fname: value });
};
getPanelHeight = () => {
// //计算表格高度
// var box1=document.getElementById("dailyTrain-bottom-right");
// if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
// return box1.offsetHeight * 0.91;
// }
return 300;
};
SearchChange = value => {
alert(value);
};
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() {
let defaultPageConfig = this.pageConfig;
let { pagination, isChecked, data, totalCount, selectedRowKeys } = this.state;
return (
<div className="dailyTrain-bottom-right" id="dailyTrain-bottom-right">
<div className="dailyTrain-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
/>
</div>
</div>
</div>
);
}
}
DailyTrainRight.propTypes = {};
export default DailyTrainRight;
...@@ -2,12 +2,10 @@ import React, { Component } from 'react'; ...@@ -2,12 +2,10 @@ import React, { Component } from 'react';
import DailyTrainyLeft from './DailyTrainLeft'; import DailyTrainyLeft from './DailyTrainLeft';
import DailyTrainRight from './DailyTrainRight'; import DailyTrainRight from './DailyTrainRight';
/** /**
* 日常训练模块 * 日常训练模块
*/ */
export default class DailyTrain extends Component { export default class DailyTrain extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -15,25 +13,23 @@ export default class DailyTrain extends Component { ...@@ -15,25 +13,23 @@ export default class DailyTrain extends Component {
}; };
} }
componentDidMount(){ componentDidMount() {
//右侧窗口默认显示第一个数据查询的列表 //右侧窗口默认显示第一个数据查询的列表
this.list && this.list.onRequestTable((list) => this.onEditClick(list[0])) this.list && this.list.onRequestTable(list => this.onEditClick(list[0]));
}
onEditClick = (record) => {
this.listTwo.onEdit(record.key)
} }
onEditClick = record => {
this.listTwo.onEdit(record.key);
};
render() { render() {
return ( return (
<div className="dailyTrain-safety"> <div className="dailyTrain-safety">
<div className="dailyTrain-safty-content"> <div className="dailyTrain-safty-content">
<div className="dailyTrain-top"></div> <div className="dailyTrain-top" />
<div className="dailyTrain-bottom"> <div className="dailyTrain-bottom">
<DailyTrainyLeft ref={node => this.list = node} onEditClick={this.onEditClick}/> <DailyTrainyLeft ref={node => (this.list = node)} onEditClick={this.onEditClick} />
<DailyTrainRight ref={node => this.listTwo = node}/> <DailyTrainRight ref={node => (this.listTwo = node)} />
</div> </div>
</div> </div>
</div> </div>
......
import React, { Component } from 'react';
import { Input } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable';
const Search = Input.Search;
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
align: 'center', // 设置文本居中的属性
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '换流站名称',
width: '20%',
dataIndex: 'name',
render: val => <span style={{ color: 'yellow' }}>{val}</span>
},
{
title: '装备类型',
width: '10%',
dataIndex: 'zblx',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '累计保养',
width: '10%',
dataIndex: 'ljby',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '保养中',
width: '10%',
dataIndex: 'byz',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: <div className="safe-table-title-font-red">逾期保养</div>,
width: '20%',
dataIndex: 'yqby',
render: val => <span style={{ color: 'red' }}>{val}</span>
},
{
title: <div className="safe-table-title-font-red">逾期占比</div>,
width: '20%',
dataIndex: 'yqzb',
render: val => <span style={{ color: 'red' }}>{val}</span>
}
];
const data = [
{
key: '1',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '2',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '3',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '4',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '5',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '6',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '7',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '8',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '9',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '10',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '11',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '12',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '13',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '14',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '15',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '16',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '17',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '18',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '19',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '20',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '21',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '22',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '23',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '225',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '25',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '26',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '27',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '28',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
},
{
key: '29',
name: '复龙换流站',
zblx: 9,
ljby: 170,
byz: 100,
yqby: 20,
yqzb: '16.7%'
}
];
/**
* 器材保养左侧
*/
class EquipmentMaintainLeft extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 14
};
this.state = {
data: [],
loading: false,
equimentId: null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList: [],
totalCount: 0,
searchParam: '',
fname: '',
current: 1,
pageSize: 10,
total: 0,
tableHeight: 450
};
}
componentDidMount() {
const { pagination } = this.state;
var box1 = document.getElementById('equipmentMaintain-bottom-left');
var box2 = document.getElementById('one-div');
if (box1 && box2) {
//此处在加一层判断,更加严密,如果box存在的情况下获取
console.log(box1.offsetHeight);
console.log(box2.offsetHeight);
this.setState({
tableHeight: box1.offsetHeight - box2.offsetHeight
});
}
}
onRequestTable = callback => {
this.setState({
data: data,
totalCount: data.length
});
callback && callback(data);
};
onChange = (value, item) => {
console.log(value, item);
};
onTimeChange = (value, dateString) => {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
};
onOk = value => {
console.log('onOk: ', value);
};
onChangeSelect = (value, item) => {
console.log(value, item);
};
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () => {
this.setState({
data: data
});
};
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData = () => {
let name = this.state.fname;
alert(name);
};
onChange = (e, value) => {
this.setState({ fname: value });
};
getPanelHeight = () => {
//计算表格高度
var box1 = document.getElementById('equipmentMaintain-bottom-left');
if (box1) {
//此处在加一层判断,更加严密,如果box存在的情况下获取
return box1.offsetHeight * 0.91;
}
};
SearchChange = value => {
alert(value);
};
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() {
let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state;
const { onEditClick } = this.props;
let { pagination, isChecked, fname, data, totalCount, selectedRowKeys } = this.state;
return (
<div className="equipmentMaintain-bottom-left" id="equipmentMaintain-bottom-left">
<div className="equipmentMaintain-bottom-left-content">
<div className="one-div" id="one-div">
<div className="search-one">
{/* <div className="search-one-button" onClick={this.searchData} /> */}
<div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} />
</div>
</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
onRowClick={record => onEditClick(record)}
/>
</div>
</div>
</div>
);
}
}
EquipmentMaintainLeft.propTypes = {};
export default EquipmentMaintainLeft;
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts';
import { Table } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable'; import AmosGridTable from './../safetyManage/AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd';
import moment from 'moment';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option;
const Search = Input.Search;
const columns = [ const columns = [
{ {
title: '序号', title: '序号',
dataIndex: 'key', dataIndex: 'key',
width: '10%', width: '10%',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '装备名称', title: '装备名称',
width: '20%', width: '20%',
dataIndex: 'zbmc', dataIndex: 'zbmc',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '装备分类', title: '装备分类',
width: '20%', width: '20%',
dataIndex: 'zbfl', dataIndex: 'zbfl',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '计量单位', title: '计量单位',
width: '20%', width: '20%',
dataIndex: 'jldw', dataIndex: 'jldw',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '保养周期', title: '保养周期',
width: '20%', width: '20%',
dataIndex: 'byzq', dataIndex: 'byzq',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: <div className='safe-table-title-font-red-right'>逾期数量</div>, title: <div className="safe-table-title-font-red-right">逾期数量</div>,
width: '10%', width: '10%',
dataIndex: 'dbtj', dataIndex: 'dbtj',
render: val => <span style={{color:"red"}}>{val}</span>, render: val => <span style={{ color: 'red' }}>{val}</span>
} }
]; ];
const data = [ const data = [
{ {
key: '1', key: '1',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '2', key: '2',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '3', key: '3',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '4', key: '4',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '5', key: '5',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '6', key: '6',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '7', key: '7',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '8', key: '8',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '9', key: '9',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '10', key: '10',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '11', key: '11',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '12', key: '12',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '13', key: '13',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '14', key: '14',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '15', key: '15',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '16', key: '16',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '17', key: '17',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '18', key: '18',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '19', key: '19',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '20', key: '20',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '21', key: '21',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '22', key: '22',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '23', key: '23',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '225', key: '225',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '25', key: '25',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '26', key: '26',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '27', key: '27',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '28', key: '28',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
}, },
{ {
key: '29', key: '29',
zbmc: '灭火防护服', zbmc: '灭火防护服',
zbfl: "个人防护类", zbfl: '个人防护类',
jldw:'个', jldw: '个',
byzq: '6月', byzq: '6月',
dbtj:12, dbtj: 12
} }
]; ];
const selectdata = [ const selectdata = [
{ id: 0, name: '消防理论知识培训' }, { id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' }, { id: 1, name: '消防技能培训' },
...@@ -303,22 +284,16 @@ const selectdata = [ ...@@ -303,22 +284,16 @@ const selectdata = [
{ id: 4, name: '火灾隐患管理' }, { id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' } { id: 5, name: '用火用电管理' }
]; ];
//偏移 //偏移
const offsetHeight = 110; const offsetHeight = 110;
const defaultHeight = 450; const defaultHeight = 450;
/** /**
* 器材保养右侧 * 器材保养右侧
*/ */
class EquipmentMaintainRight extends Component { class EquipmentMaintainRight extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.pageConfig = { this.pageConfig = {
...@@ -328,39 +303,38 @@ class EquipmentMaintainRight extends Component { ...@@ -328,39 +303,38 @@ class EquipmentMaintainRight extends Component {
this.state = { this.state = {
data: [], data: [],
loading: false, loading: false,
equimentId:null, equimentId: null,
pagination: true, pagination: true,
isChecked: false, isChecked: false,
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
dataList: [], dataList: [],
newDataList:[], newDataList: [],
totalCount:0, totalCount: 0,
searchParam:'', searchParam: '',
fname:'', fname: '',
current: 1, current: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
tableHeight:450 tableHeight: 450
}; };
} }
componentDidMount() { componentDidMount() {
const { pagination } = this.state; const { pagination } = this.state;
var box1=document.getElementById("equipmentMaintain-bottom-left"); var box1 = document.getElementById('equipmentMaintain-bottom-left');
var box2=document.getElementById("one-div"); var box2 = document.getElementById('one-div');
if(box1 && box2){ //此处在加一层判断,更加严密,如果box存在的情况下获取 if (box1 && box2) {
//此处在加一层判断,更加严密,如果box存在的情况下获取
console.log(box1.offsetHeight); console.log(box1.offsetHeight);
console.log(box2.offsetHeight); console.log(box2.offsetHeight);
this.setState({ this.setState({
tableHeight:(box1.offsetHeight-box2.offsetHeight) tableHeight: box1.offsetHeight - box2.offsetHeight
}) });
} }
} }
onEdit = (id) => { onEdit = id => {
// this.type = 'edit'; // this.type = 'edit';
// electricFireDetailsAction(id).then(d => { // electricFireDetailsAction(id).then(d => {
// this.setState({ // this.setState({
...@@ -368,37 +342,29 @@ class EquipmentMaintainRight extends Component { ...@@ -368,37 +342,29 @@ class EquipmentMaintainRight extends Component {
// title: d.name // title: d.name
// }) // })
// }) // })
console.log("id:" + id) console.log('id:' + id);
this.setState({ this.setState({
data:data, data: data,
totalCount:data.length totalCount: data.length
}) });
} };
onChange = (value, item) =>{
onChange = (value, item) => {
console.log(value, item); console.log(value, item);
};
} onTimeChange = (value, dateString) => {
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value); console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString); console.log('Formatted Selected Time: ', dateString);
} };
onOk=(value) =>{ onOk = value => {
console.log('onOk: ', value); console.log('onOk: ', value);
} };
onChangeSelect = (value, item) =>{
onChangeSelect = (value, item) => {
console.log(value, item); console.log(value, item);
};
}
reload = r => { reload = r => {
this.setState( this.setState(
...@@ -412,12 +378,11 @@ class EquipmentMaintainRight extends Component { ...@@ -412,12 +378,11 @@ class EquipmentMaintainRight extends Component {
); );
}; };
getAcitonData = () => {
getAcitonData = () =>{
// this.setState({ // this.setState({
// data:data // data:data
// }) // })
} };
/** /**
* 分页设置参数 * 分页设置参数
...@@ -439,58 +404,46 @@ class EquipmentMaintainRight extends Component { ...@@ -439,58 +404,46 @@ class EquipmentMaintainRight extends Component {
// callBack(selectedRowKeys,riskSourceId,equipmentId); // callBack(selectedRowKeys,riskSourceId,equipmentId);
}; };
searchData =()=>{ searchData = () => {
let name = this.state.fname; let name = this.state.fname;
alert(name) alert(name);
} };
onChange = (e,value) =>{
onChange = (e, value) => {
this.setState({ fname: value }); this.setState({ fname: value });
} };
getPanelHeight = () => { getPanelHeight = () => {
// //计算表格高度 // //计算表格高度
// var box1=document.getElementById("equipmentMaintain-bottom-right"); // var box1=document.getElementById("equipmentMaintain-bottom-right");
// if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取 // if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
// return box1.offsetHeight * 0.91; // return box1.offsetHeight * 0.91;
// } // }
return 300 return 300;
}; };
SearchChange = (value) => { SearchChange = value => {
alert(value) alert(value);
} };
rowClassName = (record, index) => { rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02'; let className = index % 2 ? 'back-01' : 'back-02';
return className return className;
} };
render() { render() {
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state; const { current, pageSize, total } = this.state;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state; let { pagination, isChecked, fname, data, totalCount, selectedRowKeys } = this.state;
return ( return (
<div className="equipmentMaintain-bottom-right" id="equipmentMaintain-bottom-right"> <div className="equipmentMaintain-bottom-right" id="equipmentMaintain-bottom-right">
<div className="equipmentMaintain-bottom-right-content"> <div className="equipmentMaintain-bottom-right-content">
<div className="one-div"> <div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div> <div className=" content-font-wenzi"> 中州换流站</div>
</div> </div>
<div className="two-div"> <div className="two-div">
<AmosGridTable <AmosGridTable
columns={columns} columns={columns}
dataList={data} dataList={data}
...@@ -506,10 +459,6 @@ rowClassName = (record, index) => { ...@@ -506,10 +459,6 @@ rowClassName = (record, index) => {
getPanelHeight={this.getPanelHeight} getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName} rowClassName={this.rowClassName}
/> />
</div> </div>
</div> </div>
</div> </div>
...@@ -517,9 +466,6 @@ rowClassName = (record, index) => { ...@@ -517,9 +466,6 @@ rowClassName = (record, index) => {
} }
} }
EquipmentMaintainRight.propTypes = {};
EquipmentMaintainRight.propTypes = {
};
export default EquipmentMaintainRight; export default EquipmentMaintainRight;
...@@ -2,12 +2,10 @@ import React, { Component } from 'react'; ...@@ -2,12 +2,10 @@ import React, { Component } from 'react';
import EquipmentMaintainLeft from './EquipmentMaintainLeft'; import EquipmentMaintainLeft from './EquipmentMaintainLeft';
import EquipmentMaintainRight from './EquipmentMaintainRight'; import EquipmentMaintainRight from './EquipmentMaintainRight';
/** /**
* 器材保养模块 * 器材保养模块
*/ */
export default class EquipmentMaintainTrain extends Component { export default class EquipmentMaintainTrain extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -15,16 +13,14 @@ export default class EquipmentMaintainTrain extends Component { ...@@ -15,16 +13,14 @@ export default class EquipmentMaintainTrain extends Component {
}; };
} }
componentDidMount(){ componentDidMount() {
//右侧窗口默认显示第一个数据查询的列表 //右侧窗口默认显示第一个数据查询的列表
this.list && this.list.onRequestTable((list) => this.onEditClick(list[0])) this.list && this.list.onRequestTable(list => this.onEditClick(list[0]));
}
onEditClick = (record) => {
this.listTwo.onEdit(record.key)
} }
onEditClick = record => {
this.listTwo.onEdit(record.key);
};
render() { render() {
return ( return (
...@@ -32,8 +28,8 @@ export default class EquipmentMaintainTrain extends Component { ...@@ -32,8 +28,8 @@ export default class EquipmentMaintainTrain extends Component {
<div className="equipmentMaintain-safty-content"> <div className="equipmentMaintain-safty-content">
<div className="equipmentMaintain-top"></div> <div className="equipmentMaintain-top"></div>
<div className="equipmentMaintain-bottom"> <div className="equipmentMaintain-bottom">
<EquipmentMaintainLeft ref={node => this.list = node} onEditClick={this.onEditClick}/> <EquipmentMaintainLeft ref={node => (this.list = node)} onEditClick={this.onEditClick} />
<EquipmentMaintainRight ref={node => this.listTwo = node}/> <EquipmentMaintainRight ref={node => (this.listTwo = node)} />
</div> </div>
</div> </div>
</div> </div>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import loadScripts from 'dt2react/lib/utils/loadScripts';
import { outMap } from './../../../consts/urlConsts';
import CenterLevelLeft from './../../monitor/statistical/indexLeft';
import CenterLevelRight from './../../monitor/statistical/indexRight';
/** /**
* duty * duty
...@@ -11,32 +14,63 @@ class Duty extends Component { ...@@ -11,32 +14,63 @@ class Duty extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
loadAmap: false,
BasicMap: null,
flag: false
}; };
} }
componentWillMount() { componentWillMount() {}
componentDidMount() {
this.initMap();
} }
componentDidMount() { componentWillUnmount() {}
} initMap() {
if (outMap) {
let script = null;
let mainUI = null;
componentWillUnmount() { script = {
key: 'amapscripts',
url: `/extra/amap/js/outamap.1.4.6.js?rnd= ${Math.random()}`
};
mainUI = {
key: 'mainUI',
url: '/extra/amap/js/outmain.1.4.6.js'
};
loadScripts.asyncLoadScript(script, () => {
loadScripts.asyncLoadScript(mainUI, () => {
setTimeout(() => {
this.setState({
loadAmap: true,
BasicMap: require('./mapScreen/BasicMap')
});
}, 2000);
});
});
} else {
this.setState({
loadAmap: true,
BasicMap: require('./mapScreen/BasicMap')
});
}
} }
render() { render() {
let BasicMap = this.state.BasicMap;
return ( return (
<div className="duty-root"> <div className="duty-root">
{this.state.loadAmap && <BasicMap />}
<CenterLevelLeft />
<CenterLevelRight />
</div> </div>
); );
} }
} }
Duty.propTypes = { Duty.propTypes = {};
};
export default Duty; export default Duty;
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import { BaseMap, Marker, Polyline } from 'amos-amap';
import classNames from 'classnames'; import { _picURI, _mapCenter,outMap } from './../../../../consts/urlConsts';
import { BaseMap, Marker, Polyline, Circle } from 'amos-amap'; import imgStatic from './../../../../consts/imgStatic';
import { _picURI, _mapCenter } from './../../../consts/urlConsts'; import mapData from './../../../../_mock/mapData';
import imgStatic from './../../../consts/imgStatic';
import mapData from './../../../_mock/mapData';
import { getIcon } from './conf'; import { getIcon } from './conf';
import { up } from './conf'; import { up } from './conf';
import { utils } from 'amos-tool';
import { outMap } from './../../../consts/urlConsts';
const mapIcon = imgStatic.mapIcon; const mapIcon = imgStatic.mapIcon;
const showZoom = 5; const showZoom = 5;
...@@ -16,7 +13,6 @@ const mapConfig = { ...@@ -16,7 +13,6 @@ const mapConfig = {
zoom: showZoom, zoom: showZoom,
resizeEnable: true, resizeEnable: true,
zoomEnable: true, zoomEnable: true,
// plugins: ['Scale', 'MapType', 'OverView', 'ControlBar'],
plugins: ['Scale'], plugins: ['Scale'],
zooms: [showZoom, showZoom], zooms: [showZoom, showZoom],
expandZoomRange: true, expandZoomRange: true,
...@@ -36,7 +32,6 @@ const layers = [ ...@@ -36,7 +32,6 @@ const layers = [
const statusEnum = { '2': '告警', '3': '高风险' }; const statusEnum = { '2': '告警', '3': '高风险' };
/** /**
* 地图首页 * 地图首页
* *
...@@ -55,14 +50,14 @@ class BasicMap extends Component { ...@@ -55,14 +50,14 @@ class BasicMap extends Component {
}; };
} }
componentDidMount(){ componentDidMount() {
this.initData(); this.initData();
} }
initData = () => { initData = () => {
let temp = []; let temp = [];
mapData.map(item => { mapData.map(item => {
if (item.status !== 1){ if (item.status !== 1) {
temp.push(item); temp.push(item);
} }
}); });
...@@ -70,23 +65,23 @@ class BasicMap extends Component { ...@@ -70,23 +65,23 @@ class BasicMap extends Component {
this.setState({ this.setState({
alarmList: temp alarmList: temp
}); });
} };
initMap = () => { initMap = () => {
window.map.on('click', function(e) { window.map.on('click', function(e) {
document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat() document.getElementById('lnglat').value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
}); });
}; };
onClick = (e) =>{ onClick = e => {
let visibleList = e.aliasName; let visibleList = e.aliasName;
let num = 0; let num = 0;
let temp = {}; let temp = {};
mapData.map(item => { mapData.map(item => {
if (visibleList.includes(item.name)){ if (visibleList.includes(item.name)) {
num = num + 1; num = num + 1;
item.title = true; item.title = true;
if (num === 1 ){ if (num === 1) {
temp = item; temp = item;
} }
} else { } else {
...@@ -97,39 +92,39 @@ class BasicMap extends Component { ...@@ -97,39 +92,39 @@ class BasicMap extends Component {
visible: true, visible: true,
selectData: temp selectData: temp
}); });
setTimeout(()=>{ setTimeout(() => {
this.setState({ this.setState({
visible: false visible: false
}); });
},500); }, 500);
} };
renderAliasLine = (e) => { renderAliasLine = e => {
let { selectData } = this.state; let { selectData } = this.state;
let divStyle = { let divStyle = {
marginTop: '-11px', marginTop: '-11px',
transform: `rotate(${selectData.gradient}deg)` transform: `rotate(${selectData.gradient}deg)`
}; };
if (selectData.gradient <= 0){ if (selectData.gradient <= 0) {
divStyle.marginTop = '-50px'; divStyle.marginTop = '-50px';
} }
if (selectData.position === 'right'){ if (selectData.position === 'right') {
divStyle.right = '0px'; divStyle.right = '0px';
} }
if (selectData.pathName){ if (selectData.pathName) {
return ( return (
<Marker key={selectData.id} zIndex={1} position={{ longitude: selectData.lng, latitude: selectData.lat }}> <Marker key={selectData.id} zIndex={1} position={{ longitude: selectData.lng, latitude: selectData.lat }}>
<div className={`content-alias`} style={divStyle}> <div className={`content-alias`} style={divStyle}>
<img src={mapIcon.alias_line} style={{ width: `${selectData.width}px`, height: `${selectData.height}px` }}></img> <img src={mapIcon.alias_line} style={{ width: `${selectData.width}px`, height: `${selectData.height}px` }} />
<img src={mapIcon.alias_title} className='alias-title'></img> <img src={mapIcon.alias_title} className="alias-title" />
<span style={{ width: `${selectData.width}px` }}>{selectData.pathName}</span> <span style={{ width: `${selectData.width}px` }}>{selectData.pathName}</span>
</div> </div>
</Marker> </Marker>
); );
} }
} };
/** /**
* 设置末端marker * 设置末端marker
...@@ -137,28 +132,33 @@ class BasicMap extends Component { ...@@ -137,28 +132,33 @@ class BasicMap extends Component {
* @memberof BasicMap * @memberof BasicMap
*/ */
setBodyMarker = () => { setBodyMarker = () => {
let { aliasName } = this.state;
return (mapData || []).map((item, index) => { return (mapData || []).map((item, index) => {
if (item.type === 'center') { if (item.type === 'center') {
return (<Marker key={item.id} zIndex={1} position={{ longitude: item.lng, latitude: item.lat }}> return (
<Marker key={item.id} zIndex={1} position={{ longitude: item.lng, latitude: item.lat }}>
<div className={`marker-center`}> <div className={`marker-center`}>
<div className='title'> <div className="title">
<span>{item.name}</span> <span>{item.name}</span>
<img src={mapIcon.endmost_title_2} /> <img src={mapIcon.endmost_title_2} />
</div> </div>
<img src={getIcon(item.type, item.status)}></img> <img src={getIcon(item.type, item.status)}></img>
</div> </div>
</Marker>); </Marker>
);
} else { } else {
return (<Marker key={item.id} zIndex={1} position={{ longitude: item.lng, latitude: item.lat }}> return (
<Marker key={item.id} zIndex={1} position={{ longitude: item.lng, latitude: item.lat }}>
<div className={`marker-icon`}> <div className={`marker-icon`}>
{ item.title && <div className='title'> {item.title && (
<div className="title">
<span>{item.name}</span> <span>{item.name}</span>
<img src={getIcon(item.type, 'title_' + item.status)} /> <img src={getIcon(item.type, 'title_' + item.status)} />
</div>} </div>
)}
<img src={getIcon(item.type, item.status)} onClick={() => this.onClick(item)}></img> <img src={getIcon(item.type, item.status)} onClick={() => this.onClick(item)}></img>
</div> </div>
</Marker>); </Marker>
);
} }
}); });
}; };
...@@ -172,13 +172,7 @@ class BasicMap extends Component { ...@@ -172,13 +172,7 @@ class BasicMap extends Component {
let { lineStyle } = this.state; let { lineStyle } = this.state;
return (mapData || []).map((item, index) => { return (mapData || []).map((item, index) => {
if (item) { if (item) {
return ( <Polyline return <Polyline key={item.id} zIndex={11} path={item.path} style={lineStyle} extData={item} />;
key={item.id}
zIndex={11}
path={item.path}
style={lineStyle}
extData={item}
/>);
} }
}); });
}; };
...@@ -187,37 +181,38 @@ class BasicMap extends Component { ...@@ -187,37 +181,38 @@ class BasicMap extends Component {
let { alarmList } = this.state; let { alarmList } = this.state;
return (alarmList || []).map((item, index) => { return (alarmList || []).map((item, index) => {
if (item) { if (item) {
return (<div className={`row-${item.status}`} key={index}> return (
<div className={`row-${item.status}`} key={index}>
<span>{item.name}</span> <span>{item.name}</span>
<span className='right'>{statusEnum[item.status]}</span> <span className="right">{statusEnum[item.status]}</span>
</div>); </div>
);
} }
}); });
} };
buildExplain = () => { buildExplain = () => {
return ( return (
<div className='content-explain'> <div className="content-explain">
<div className='row'> <div className="row">
<div className='fault'></div> <div className="fault"></div>
<span>高风险</span> <span>高风险</span>
</div> </div>
<div className='row'> <div className="row">
<div className='alarm'></div> <div className="alarm"></div>
<span>告警</span> <span>告警</span>
</div> </div>
<div className='row'> <div className="row">
<div className='normal'></div> <div className="normal"></div>
<span>安全</span> <span>安全</span>
</div> </div>
</div> </div>
); );
} };
setInstanceToGlobal = inst => { setInstanceToGlobal = inst => {
this.map = inst; this.map = inst;
window.map = inst; window.map = inst;
//this.initMap();
}; };
render() { render() {
...@@ -231,20 +226,15 @@ class BasicMap extends Component { ...@@ -231,20 +226,15 @@ class BasicMap extends Component {
let { mapCenter, visible } = this.state; let { mapCenter, visible } = this.state;
return ( return (
<div className="map-root"> <div className="map-root">
<div className='content-alarm'> <div className="content-alarm">{this.buildAlarm()}</div>
{this.buildAlarm()} {visible && (
</div> <div className="loading">
{visible && <div className='loading'>
<img src={mapIcon.loading}></img> <img src={mapIcon.loading}></img>
<span>数据更新完毕!</span> <span>数据更新完毕!</span>
</div>} </div>
<div className='map'> )}
<BaseMap events={events} <div className="map">
useAMapUI <BaseMap events={events} useAMapUI center={mapCenter} {...mapConfig} dragEnable={false}>
center={mapCenter}
{...mapConfig}
dragEnable={false}
>
{this.setBodyMarker()} {this.setBodyMarker()}
{this.setBodyLine()} {this.setBodyLine()}
{this.renderAliasLine()} {this.renderAliasLine()}
...@@ -261,7 +251,6 @@ class BasicMap extends Component { ...@@ -261,7 +251,6 @@ class BasicMap extends Component {
} }
} }
BasicMap.propTypes = { BasicMap.propTypes = {};
};
export default BasicMap; export default BasicMap;
import imgStatic from './../../../consts/imgStatic'; import imgStatic from './../../../../consts/imgStatic';
const mapIcon = imgStatic.mapIcon;
const mapIcon = imgStatic.mapIcon;
export const up = (x,y) => { export const up = (x,y) => {
return y.status - x.status; return y.status - x.status;
}; };
export const getIcon = (type, status) => { export const getIcon = (type, status) => {
return mapIcon[`${type}_${status}`]; return mapIcon[`${type}_${status}`];
}; };
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import { Input } from 'amos-antd';
import { Table } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable'; import AmosGridTable from './../safetyManage/AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd';
import moment from 'moment';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
const columns = [ const columns = [
...@@ -23,44 +10,43 @@ const columns = [ ...@@ -23,44 +10,43 @@ const columns = [
dataIndex: 'key', dataIndex: 'key',
width: '10%', width: '10%',
align: 'center', // 设置文本居中的属性 align: 'center', // 设置文本居中的属性
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '换流站名称', title: '换流站名称',
width: '20%', width: '20%',
dataIndex: 'name', dataIndex: 'name',
render: val => <span style={{color:"yellow"}}>{val}</span>, render: val => <span style={{ color: 'yellow' }}>{val}</span>
}, },
{ {
title: <div className = "safe-table-title-font-grey">日巡检计划</div>, title: <div className="safe-table-title-font-grey">日巡检计划</div>,
width: '15%', width: '15%',
dataIndex: 'rxjjh', dataIndex: 'rxjjh',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: <div className = "safe-table-title-font-grey">月巡检计划</div>, title: <div className="safe-table-title-font-grey">月巡检计划</div>,
width: '15%', width: '15%',
dataIndex: 'yxjjh', dataIndex: 'yxjjh',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: <div className = "safe-table-title-font-grey">季度巡检计划</div>, title: <div className="safe-table-title-font-grey">季度巡检计划</div>,
width: '15%', width: '15%',
dataIndex: 'jdxjjh', dataIndex: 'jdxjjh',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '发现隐患数', title: '发现隐患数',
width: '10%', width: '10%',
dataIndex: 'fxyhs', dataIndex: 'fxyhs',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '处理隐患数', title: '处理隐患数',
width: '15%', width: '15%',
dataIndex: 'clyhs', dataIndex: 'clyhs',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
} }
]; ];
const data = [ const data = [
...@@ -68,289 +54,269 @@ const data = [ ...@@ -68,289 +54,269 @@ const data = [
key: '1', key: '1',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '2', key: '2',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '3', key: '3',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '4', key: '4',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '5', key: '5',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '6', key: '6',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '7', key: '7',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '8', key: '8',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '9', key: '9',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '10', key: '10',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '11', key: '11',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '12', key: '12',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '13', key: '13',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '14', key: '14',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '15', key: '15',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '16', key: '16',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '17', key: '17',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '18', key: '18',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '19', key: '19',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '20', key: '20',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '21', key: '21',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '22', key: '22',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '23', key: '23',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '225', key: '225',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '25', key: '25',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '26', key: '26',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '27', key: '27',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '28', key: '28',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
}, },
{ {
key: '29', key: '29',
name: '复龙换流站', name: '复龙换流站',
rxjjh: 170, rxjjh: 170,
yxjjh:100, yxjjh: 100,
jdxjjh:270, jdxjjh: 270,
fxyhs: 3, fxyhs: 3,
clyhs:7, clyhs: 7
} }
]; ];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/** /**
* 安全巡检 * 安全巡检
*/ */
class SafetyInspectionLeft extends Component { class SafetyInspectionLeft extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.pageConfig = { this.pageConfig = {
...@@ -360,53 +326,41 @@ class SafetyInspectionLeft extends Component { ...@@ -360,53 +326,41 @@ class SafetyInspectionLeft extends Component {
this.state = { this.state = {
data: [], data: [],
loading: false, loading: false,
equimentId:null, equimentId: null,
pagination: true, pagination: true,
isChecked: false, isChecked: false,
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
dataList: [], dataList: [],
newDataList:[], newDataList: [],
totalCount:0, totalCount: 0,
searchParam:'', searchParam: '',
fname:'', fname: '',
current: 1, current: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
tableHeight:450 tableHeight: 450
}; };
} }
componentDidMount() { componentDidMount() {}
}
onChange = (value, item) =>{
onChange = (value, item) => {
console.log(value, item); console.log(value, item);
};
} onTimeChange = (value, dateString) => {
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value); console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString); console.log('Formatted Selected Time: ', dateString);
} };
onOk=(value) =>{ onOk = value => {
console.log('onOk: ', value); console.log('onOk: ', value);
} };
onChangeSelect = (value, item) =>{
onChangeSelect = (value, item) => {
console.log(value, item); console.log(value, item);
};
}
reload = r => { reload = r => {
this.setState( this.setState(
...@@ -420,12 +374,11 @@ class SafetyInspectionLeft extends Component { ...@@ -420,12 +374,11 @@ class SafetyInspectionLeft extends Component {
); );
}; };
getAcitonData = () => {
getAcitonData = () =>{
this.setState({ this.setState({
data:data data: data
}) });
} };
/** /**
* 分页设置参数 * 分页设置参数
...@@ -447,41 +400,37 @@ class SafetyInspectionLeft extends Component { ...@@ -447,41 +400,37 @@ class SafetyInspectionLeft extends Component {
// callBack(selectedRowKeys,riskSourceId,equipmentId); // callBack(selectedRowKeys,riskSourceId,equipmentId);
}; };
searchData =()=>{ searchData = () => {
let name = this.state.fname; let name = this.state.fname;
alert(name) alert(name);
} };
onChange = (e,value) =>{
onChange = (e, value) => {
this.setState({ fname: value }); this.setState({ fname: value });
} };
getPanelHeight = () => { getPanelHeight = () => {
//计算表格高度 //计算表格高度
var box1=document.getElementById("safetyInspection-bottom-left"); var box1 = document.getElementById('safetyInspection-bottom-left');
if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取 if (box1) {
return box1.offsetHeight * 0.91 //此处在加一层判断,更加严密,如果box存在的情况下获取
return box1.offsetHeight * 0.91;
} }
}; };
SearchChange = (value) => { SearchChange = value => {
alert(value) alert(value);
} };
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() { render() {
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state; const { current, pageSize, total } = this.state;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state; let { pagination, isChecked, fname, data, totalCount, selectedRowKeys } = this.state;
return ( return (
<div className="safetyInspection-bottom-left" id="safetyInspection-bottom-left"> <div className="safetyInspection-bottom-left" id="safetyInspection-bottom-left">
<div className="safetyInspection-bottom-left-content"> <div className="safetyInspection-bottom-left-content">
...@@ -491,14 +440,9 @@ rowClassName = (record, index) => { ...@@ -491,14 +440,9 @@ rowClassName = (record, index) => {
<div className="search-one-input"> <div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
</div> </div>
<div className="two-div"> <div className="two-div">
<AmosGridTable <AmosGridTable
columns={columns} columns={columns}
dataList={data} dataList={data}
...@@ -514,22 +458,13 @@ rowClassName = (record, index) => { ...@@ -514,22 +458,13 @@ rowClassName = (record, index) => {
getPanelHeight={this.getPanelHeight} getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName} rowClassName={this.rowClassName}
/> />
</div> </div>
</div> </div>
</div> </div>
); );
} }
} }
SafetyInspectionLeft.propTypes = {};
SafetyInspectionLeft.propTypes = {
};
export default SafetyInspectionLeft; export default SafetyInspectionLeft;
import React, { Component } from 'react'; import React, { Component } from 'react';
import SafetyInspectionLeft from './SafetyInspectionLeft'; import SafetyInspectionLeft from './SafetyInspectionLeft';
/** /**
* 安全巡检模块 * 安全巡检模块
*/ */
export default class SafetyInspection extends Component { export default class SafetyInspection extends Component {
render() { render() {
return ( return (
<div className="safetyInspection-safety"> <div className="safetyInspection-safety">
...@@ -14,7 +12,6 @@ export default class SafetyInspection extends Component { ...@@ -14,7 +12,6 @@ export default class SafetyInspection extends Component {
<div className="safetyInspection-top"></div> <div className="safetyInspection-top"></div>
<div className="safetyInspection-bottom"> <div className="safetyInspection-bottom">
<SafetyInspectionLeft /> <SafetyInspectionLeft />
</div> </div>
</div> </div>
</div> </div>
......
...@@ -3,9 +3,6 @@ import PropTypes from 'prop-types'; ...@@ -3,9 +3,6 @@ import PropTypes from 'prop-types';
import { Table } from 'amos-antd'; import { Table } from 'amos-antd';
import { Log } from 'amos-tool'; import { Log } from 'amos-tool';
/** /**
* 基础信息表格组件 * 基础信息表格组件
* @class AmosGridTable * @class AmosGridTable
...@@ -15,15 +12,15 @@ class AmosGridTable extends Component { ...@@ -15,15 +12,15 @@ class AmosGridTable extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedRowKeys: [],//表格选择的行key值集合 selectedRowKeys: [], //表格选择的行key值集合
selectedRows: [],//表格选择的行数据集合 selectedRows: [], //表格选择的行数据集合
loading: false,//页面是否加载中,默认false loading: false, //页面是否加载中,默认false
dataList: [],//表格数据集合 dataList: [], //表格数据集合
size: 'middle',//表格大小 size: 'middle', //表格大小
current: props.defaultPageConfig ? props.defaultPageConfig.current : 1,//当前页初始索引0 current: props.defaultPageConfig ? props.defaultPageConfig.current : 1, //当前页初始索引0
pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10,//当前页数据量 pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10, //当前页数据量
filter: {},//表格过滤条件 filter: {}, //表格过滤条件
totals: 1,//所有数据总和 totals: 1, //所有数据总和
showFilter: true, showFilter: true,
otherFilter: props.otherFilter, otherFilter: props.otherFilter,
maxHeight: 450 maxHeight: 450
...@@ -40,10 +37,10 @@ class AmosGridTable extends Component { ...@@ -40,10 +37,10 @@ class AmosGridTable extends Component {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if (nextProps.url !== this.props.url){ if (nextProps.url !== this.props.url) {
this.reload(); this.reload();
} }
if (nextProps.otherFilter && nextProps.otherFilter !== this.props.otherFilter){ if (nextProps.otherFilter && nextProps.otherFilter !== this.props.otherFilter) {
this.setState({ otherFilter: nextProps.otherFilter }, this.reload); this.setState({ otherFilter: nextProps.otherFilter }, this.reload);
} }
} }
...@@ -52,104 +49,111 @@ class AmosGridTable extends Component { ...@@ -52,104 +49,111 @@ class AmosGridTable extends Component {
window.removeEventListener('resize', this.onWindowResize); window.removeEventListener('resize', this.onWindowResize);
} }
onWindowResize = (e) => { onWindowResize = e => {
this.getHeightOffset(); this.getHeightOffset();
} };
/** /**
* 获取复选框选择的数据,并进行回调 * 获取复选框选择的数据,并进行回调
*/ */
onSelectChange = (selectedRowKeys,selectedRows) => { onSelectChange = (selectedRowKeys, selectedRows) => {
this.setState({ this.setState(
{
selectedRowKeys, selectedRowKeys,
selectedRows selectedRows
},this.props.getSelectedRows(selectedRows,selectedRowKeys)); },
} this.props.getSelectedRows(selectedRows, selectedRowKeys)
);
};
/** /**
* 设置页面数据大小事件 * 设置页面数据大小事件
*/ */
onSizeChange = (current, pageSize) => { onSizeChange = (current, pageSize) => {
let { setPageConfig } = this.props; let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current, pageSize }); setPageConfig && setPageConfig({ current, pageSize });
this.setState({ current, pageSize },this.reload); this.setState({ current, pageSize }, this.reload);
} };
/** /**
* 设置当前页事件 * 设置当前页事件
*/ */
onPaginationChange = (current) => { onPaginationChange = current => {
let { setPageConfig } = this.props; let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current }); setPageConfig && setPageConfig({ current });
this.setState({ current },this.reload); this.setState({ current }, this.reload);
} };
/** /**
* 获取表格所有的外部按钮封装成数组 * 获取表格所有的外部按钮封装成数组
*/ */
getbtns = () => { getbtns = () => {
let btns = []; let btns = [];
return <div key={`btntool`} className='amos-grid-oper-btn'>{this.props.operBtns}</div>; return (
} <div key={`btntool`} className="amos-grid-oper-btn">
{this.props.operBtns}
</div>
);
};
/** /**
* 获取表格数据的筛选条件,通过回调获得的,并通过该条件进行表格刷新获取 * 获取表格数据的筛选条件,通过回调获得的,并通过该条件进行表格刷新获取
*/ */
changeFilters = (obj) => { changeFilters = obj => {
let newobj = obj; let newobj = obj;
let res = {}; let res = {};
let list = Object.keys(newobj); let list = Object.keys(newobj);
list.map(e=>{ list.map(e => {
let varName = newobj[e]; let varName = newobj[e];
if (varName && varName !== ''){ if (varName && varName !== '') {
res[e] = varName; res[e] = varName;
if (e === 'enabled'){ if (e === 'enabled') {
res[e] = varName === '启用'; res[e] = varName === '启用';
} }
} }
}); });
this.setState({ filter: res },this.reload); this.setState({ filter: res }, this.reload);
} };
openFilter = () => { openFilter = () => {
let showFilter = this.state.showFilter; let showFilter = this.state.showFilter;
this.setState({ showFilter: !showFilter }); this.setState({ showFilter: !showFilter });
} };
/** /**
* 获取表格数据(刷新) * 获取表格数据(刷新)
*/ */
reload = () => { reload = () => {
let { current,pageSize,filter,otherFilter } = this.state; let { current, pageSize, filter, otherFilter } = this.state;
this.props.getTableDataAction({ current: current - 1, pageSize },JSON.stringify(filter),otherFilter); this.props.getTableDataAction({ current: current - 1, pageSize }, JSON.stringify(filter), otherFilter);
this.getHeightOffset(); this.getHeightOffset();
} };
/** /**
* 获取表格内部按钮 * 获取表格内部按钮
*/ */
addOperateCol =(text,record) =>{ addOperateCol = (text, record) => {
const { operateCol } = this.props; const { operateCol } = this.props;
let operBtns = operateCol(text,record); let operBtns = operateCol(text, record);
return (<div className='operation-buttons'>{operBtns}</div>); return <div className="operation-buttons">{operBtns}</div>;
} };
showTotal = (total) => { showTotal = total => {
return `共 ${total} 条`; return `共 ${total} 条`;
} };
generateRowkey = (record, index) => { generateRowkey = (record, index) => {
// return record.id ? record.id : UUID.uuidFast(); // return record.id ? record.id : UUID.uuidFast();
return record.key ? record.key : record.id ? record.id : index + (this.state.current - 1) * this.state.pageSize; return record.key ? record.key : record.id ? record.id : index + (this.state.current - 1) * this.state.pageSize;
// return index + (this.state.current - 1) * this.state.pageSize; // return index + (this.state.current - 1) * this.state.pageSize;
} };
getHeightOffset = () => { getHeightOffset = () => {
let { getPanelHeight } = this.props; let { getPanelHeight } = this.props;
let height = getPanelHeight === undefined ? 450 : getPanelHeight(); let height = getPanelHeight === undefined ? 450 : getPanelHeight();
height && this.setState({ maxHeight: height }); height && this.setState({ maxHeight: height });
} };
isVisableSearch(columns){ isVisableSearch(columns) {
let list = columns; let list = columns;
let res = false; let res = false;
list.map((e)=>{ list.map(e => {
if (e.query){ if (e.query) {
res = true; res = true;
return true; return true;
} }
...@@ -158,8 +162,8 @@ class AmosGridTable extends Component { ...@@ -158,8 +162,8 @@ class AmosGridTable extends Component {
} }
render() { render() {
const { loading, selectedRowKeys,size,maxHeight } = this.state; const { loading, selectedRowKeys, size, maxHeight } = this.state;
let { columns, isChecked, operateCol, isTreeTable, isPageable, pagination, dataList, totals,rowClassName, onRowClick, onRowDoubleClick } = this.props; let { columns, isChecked, operateCol, isTreeTable, isPageable, pagination, dataList, totals, rowClassName, onRowClick, onRowDoubleClick } = this.props;
//设置复选框参数 //设置复选框参数
let rowSelection = { let rowSelection = {
...@@ -169,10 +173,11 @@ class AmosGridTable extends Component { ...@@ -169,10 +173,11 @@ class AmosGridTable extends Component {
//设置是否添加复选框 //设置是否添加复选框
rowSelection = isChecked ? rowSelection : undefined; rowSelection = isChecked ? rowSelection : undefined;
//如果表格各行存在内部按钮,将各个按钮添加到表格列模型中 //如果表格各行存在内部按钮,将各个按钮添加到表格列模型中
if (operateCol){ if (operateCol) {
columns[columns.length - 1].render = (text,record) => this.addOperateCol(text,record); columns[columns.length - 1].render = (text, record) => this.addOperateCol(text, record);
} }
let tepmPage = Object.assign({ let tepmPage = Object.assign(
{
size: 'small', size: 'small',
total: totals, total: totals,
current: this.state.current, current: this.state.current,
...@@ -181,8 +186,10 @@ class AmosGridTable extends Component { ...@@ -181,8 +186,10 @@ class AmosGridTable extends Component {
onChange: this.onPaginationChange, onChange: this.onPaginationChange,
showSizeChanger: true, showSizeChanger: true,
showTotal: this.showTotal showTotal: this.showTotal
}, pagination); },
let _tempPagination = isPageable === false ? false :tepmPage; pagination
);
let _tempPagination = isPageable === false ? false : tepmPage;
let bordered = true; let bordered = true;
// 当为true 或 undefined时则分页 // 当为true 或 undefined时则分页
let _pagination = isPageable === false ? false : _tempPagination; let _pagination = isPageable === false ? false : _tempPagination;
...@@ -191,11 +198,9 @@ class AmosGridTable extends Component { ...@@ -191,11 +198,9 @@ class AmosGridTable extends Component {
let searchStyle = { display }; let searchStyle = { display };
return ( return (
<div className="table-styles"> <div className="table-styles">
{ onRowClick ? {onRowClick ? (
<Table <Table
rowKey={isTreeTable ? 'key' : this.generateRowkey} rowKey={isTreeTable ? 'key' : this.generateRowkey}
loading={loading} loading={loading}
rowSelection={rowSelection} rowSelection={rowSelection}
...@@ -207,9 +212,9 @@ class AmosGridTable extends Component { ...@@ -207,9 +212,9 @@ class AmosGridTable extends Component {
scroll={{ y: maxHeight }} scroll={{ y: maxHeight }}
rowClassName={rowClassName} rowClassName={rowClassName}
onRowClick={onRowClick} onRowClick={onRowClick}
/> : />
) : (
<Table <Table
rowKey={isTreeTable ? 'key' : this.generateRowkey} rowKey={isTreeTable ? 'key' : this.generateRowkey}
loading={loading} loading={loading}
rowSelection={rowSelection} rowSelection={rowSelection}
...@@ -222,22 +227,21 @@ class AmosGridTable extends Component { ...@@ -222,22 +227,21 @@ class AmosGridTable extends Component {
rowClassName={rowClassName} rowClassName={rowClassName}
onRowDoubleClick={onRowDoubleClick} onRowDoubleClick={onRowDoubleClick}
/> />
} )}
</div> </div>
); );
} }
} }
AmosGridTable.propTypes = { AmosGridTable.propTypes = {
url: PropTypes.string,//请求表格数据的url不带参数的 url: PropTypes.string, //请求表格数据的url不带参数的
columns: PropTypes.array,//表格列模型 columns: PropTypes.array, //表格列模型
getSelectedRows: PropTypes.func,//获取选择的行数据,用于各个具体的表格回调获取数据。 getSelectedRows: PropTypes.func, //获取选择的行数据,用于各个具体的表格回调获取数据。
operBtns: PropTypes.array,//表格外部操作按钮,如'新增','编辑'等 operBtns: PropTypes.array, //表格外部操作按钮,如'新增','编辑'等
isChecked: PropTypes.bool,//表格是否包含复选框 isChecked: PropTypes.bool, //表格是否包含复选框
operateCol: PropTypes.func,//表格内部操作按钮,如'查看详情'等 operateCol: PropTypes.func, //表格内部操作按钮,如'查看详情'等
callBack: PropTypes.func,//获取表格刷新方法,用于各个具体的表格回调获取,方便各种操作后进行表格刷新。 callBack: PropTypes.func, //获取表格刷新方法,用于各个具体的表格回调获取,方便各种操作后进行表格刷新。
otherFilter: PropTypes.string,//其他查询条件 otherFilter: PropTypes.string, //其他查询条件
dataList: PropTypes.array, dataList: PropTypes.array,
getTableDataAction: PropTypes.func, getTableDataAction: PropTypes.func,
selectedRowKeys: PropTypes.array, selectedRowKeys: PropTypes.array,
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts';
import { Table } from 'amos-antd';
import AmosGridTable from './AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd'; import { DatePicker } from 'amos-antd';
import moment from 'moment'; import { Input } from 'amos-antd';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework'; import { Select } from 'amos-framework';
import AmosGridTable from './AmosGridTable';
const Option = Select.Option; const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
...@@ -23,44 +13,43 @@ const columns = [ ...@@ -23,44 +13,43 @@ const columns = [
dataIndex: 'key', dataIndex: 'key',
width: '10%', width: '10%',
align: 'center', // 设置文本居中的属性 align: 'center', // 设置文本居中的属性
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '换流站名称', title: '换流站名称',
width: '20%', width: '20%',
dataIndex: 'name', dataIndex: 'name',
render: val => <span style={{color:"yellow"}}>{val}</span>, render: val => <span style={{ color: 'yellow' }}>{val}</span>
}, },
{ {
title: '科目数', title: '科目数',
width: '10%', width: '10%',
dataIndex: 'kemu', dataIndex: 'kemu',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '次数', title: '次数',
width: '10%', width: '10%',
dataIndex: 'cishu', dataIndex: 'cishu',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '参加人员', title: '参加人员',
width: '10%', width: '10%',
dataIndex: 'cjry', dataIndex: 'cjry',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '人员达标率', title: '人员达标率',
width: '20%', width: '20%',
dataIndex: 'rydbl', dataIndex: 'rydbl',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
}, },
{ {
title: '最近培训时间', title: '最近培训时间',
width: '20%', width: '20%',
dataIndex: 'date', dataIndex: 'date',
render: val => <span style={{color:"white"}}>{val}</span>, render: val => <span style={{ color: 'white' }}>{val}</span>
} }
]; ];
const data = [ const data = [
...@@ -68,267 +57,266 @@ const data = [ ...@@ -68,267 +57,266 @@ const data = [
key: '1', key: '1',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '2', key: '2',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '3', key: '3',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '4', key: '4',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '5', key: '5',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '6', key: '6',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '7', key: '7',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '8', key: '8',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '9', key: '9',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '10', key: '10',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '11', key: '11',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '12', key: '12',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '13', key: '13',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '14', key: '14',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '15', key: '15',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '16', key: '16',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '17', key: '17',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '18', key: '18',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '19', key: '19',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '20', key: '20',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '21', key: '21',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '22', key: '22',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '23', key: '23',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '225', key: '225',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '25', key: '25',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '26', key: '26',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '27', key: '27',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '28', key: '28',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
}, },
{ {
key: '29', key: '29',
name: '复龙换流站', name: '复龙换流站',
kemu: 3, kemu: 3,
cishu:4, cishu: 4,
cjry: 5, cjry: 5,
rydbl:'50%', rydbl: '50%',
date:"2019-01-01" date: '2019-01-01'
} }
]; ];
const selectdata = [ const selectdata = [
{ id: 0, name: '消防理论知识培训' }, { id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' }, { id: 1, name: '消防技能培训' },
...@@ -338,18 +326,12 @@ const selectdata = [ ...@@ -338,18 +326,12 @@ const selectdata = [
{ id: 4, name: '火灾隐患管理' }, { id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' } { id: 5, name: '用火用电管理' }
]; ];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/** /**
* 安全培训左侧 * 安全培训左侧
*/ */
class SafteyLeft extends Component { class SafteyLeft extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.pageConfig = { this.pageConfig = {
...@@ -359,67 +341,49 @@ class SafteyLeft extends Component { ...@@ -359,67 +341,49 @@ class SafteyLeft extends Component {
this.state = { this.state = {
data: [], data: [],
loading: false, loading: false,
equimentId:null, equimentId: null,
pagination: true, pagination: true,
isChecked: false, isChecked: false,
selectedRows: [], selectedRows: [],
selectedRowKeys: [], selectedRowKeys: [],
dataList: [], dataList: [],
newDataList:[], newDataList: [],
totalCount:0, totalCount: 0,
searchParam:'', searchParam: '',
fname:'', fname: '',
current: 1, current: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
tableHeight:450 tableHeight: 450
}; };
} }
componentDidMount() { componentDidMount() {}
}
onRequestTable = (callback) => {
onRequestTable = callback => {
this.setState({ this.setState({
data:data, data: data,
totalCount:data.length totalCount: data.length
}); });
callback && callback(data); callback && callback(data);
};
// electricFireListAction(current, pageSize, searchName).then(d => { onChange = (value, item) => {
// const { dataList, total } = d || {};
// });
}
onChange = (value, item) =>{
console.log(value, item); console.log(value, item);
};
} onTimeChange = (value, dateString) => {
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value); console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString); console.log('Formatted Selected Time: ', dateString);
} };
onOk=(value) =>{ onOk = value => {
console.log('onOk: ', value); console.log('onOk: ', value);
} };
onChangeSelect = (value, item) =>{
onChangeSelect = (value, item) => {
console.log(value, item); console.log(value, item);
};
}
reload = r => { reload = r => {
this.setState( this.setState(
...@@ -433,12 +397,11 @@ class SafteyLeft extends Component { ...@@ -433,12 +397,11 @@ class SafteyLeft extends Component {
); );
}; };
getAcitonData = () => {
getAcitonData = () =>{
this.setState({ this.setState({
data:data data: data
}) });
} };
/** /**
* 分页设置参数 * 分页设置参数
...@@ -456,95 +419,63 @@ class SafteyLeft extends Component { ...@@ -456,95 +419,63 @@ class SafteyLeft extends Component {
*/ */
getSelectedRows = (selectedRows, selectedRowKeys) => { getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys }); this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
}; };
searchData =()=>{ searchData = () => {
let name = this.state.fname; let name = this.state.fname;
alert(name) };
}
onChange = (e,value) =>{
onChange = (e, value) => {
this.setState({ fname: value }); this.setState({ fname: value });
} };
getPanelHeight = () => { getPanelHeight = () => {
//计算表格高度 //计算表格高度
var box1=document.getElementById("fire-bottom-left"); var box1 = document.getElementById('fire-bottom-left');
if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取 if (box1) {
return box1.offsetHeight * 0.91 //此处在加一层判断,更加严密,如果box存在的情况下获取
return box1.offsetHeight * 0.91;
} }
}; };
SearchChange = (value) => { SearchChange = value => {
alert(value) alert(value);
} };
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() { render() {
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state; let { pagination, isChecked, data, totalCount, selectedRowKeys } = this.state;
const {onEditClick} =this.props;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state;
return ( return (
<div className="fire-bottom-left" id="fire-bottom-left"> <div className="fire-bottom-left" id="fire-bottom-left">
<div className="fire-bottom-left-content"> <div className="fire-bottom-left-content">
<div className="one-div" id="one-div"> <div className="one-div" id="one-div">
<div className="search-one"> <div className="search-one">
{/* <div className="search-one-button" onClick={this.searchData} /> */}
<div className="search-one-input"> <div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
<div className="search-two" > <div className="search-two">
<Select
className="search-select-style"
<Select className="search-select-style"
data={selectdata} data={selectdata}
renderOption={item => <Option value={item.id}>{item.name}</Option>} renderOption={item => <Option value={item.id}>{item.name}</Option>}
defaultOption={<Option>请选择</Option>} defaultOption={<Option>请选择</Option>}
onChange={this.onChangeSelect} onChange={this.onChangeSelect}
/> />
</div> </div>
<div className="search-three"> <div className="search-three">
<span className="three-font">日期:&nbsp;&nbsp;</span> <span className="three-font">日期:&nbsp;&nbsp;</span>
<DatePicker <DatePicker placeholder="年-月-日" showTime onChange={this.onTimeChange} style={{ width: '37%' }} onOk={this.onOk} />
placeholder="年-月-日" &nbsp;&nbsp;<font style={{ color: '#5FFFFD' }}></font>&nbsp;&nbsp;
showTime <DatePicker placeholder="年-月-日" showTime onChange={this.onTimeChange} style={{ width: '37%' }} onOk={this.onOk} />
onChange={this.onTimeChange}
style={{width:'37%'}}
onOk={this.onOk} />
{/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */}
&nbsp;&nbsp;<font style={{color:'#5FFFFD'}}></font>&nbsp;&nbsp;
<DatePicker
placeholder="年-月-日"
showTime
onChange={this.onTimeChange}
style={{width:'37%'}}
onOk={this.onOk} />
</div> </div>
</div> </div>
<div className="two-div"> <div className="two-div">
<AmosGridTable <AmosGridTable
columns={columns} columns={columns}
dataList={data} dataList={data}
...@@ -559,24 +490,15 @@ rowClassName = (record, index) => { ...@@ -559,24 +490,15 @@ rowClassName = (record, index) => {
defaultPageConfig={defaultPageConfig} defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight} getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName} rowClassName={this.rowClassName}
onRowClick={(record) => onEditClick(record)} onRowClick={record => onEditClick(record)}
/> />
</div> </div>
</div> </div>
</div> </div>
); );
} }
} }
SafteyLeft.propTypes = {};
SafteyLeft.propTypes = {
};
export default SafteyLeft; export default SafteyLeft;
import React, { Component } from 'react';
import AmosGridTable from './AmosGridTable';
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '科目名称',
width: '15%',
dataIndex: 'kmmc',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '培训时间',
width: '15%',
dataIndex: 'pxsj',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: '参加人数',
width: '10%',
dataIndex: 'cjrs',
render: val => <span style={{ color: 'white' }}>{val}</span>
},
{
title: <div className="safe-table-title-font-red-right">0-60</div>,
width: '10%',
dataIndex: '0-60',
render: val => <span style={{ color: 'red' }}>{val}</span>
},
{
title: <div className="safe-table-title-font-yellow">61-85</div>,
width: '10%',
dataIndex: '61-85',
render: val => <span style={{ color: 'yellow' }}>{val}</span>
},
{
title: (
<div className="safe-table-title-font-green" style={{ paddingTop: '5% !important' }}>
86-100
</div>
),
width: '10%',
dataIndex: '86-100',
render: val => <span style={{ color: 'green' }}>{val}</span>
},
{
title: '达标率%',
width: '10%',
dataIndex: 'dbl',
render: val => <span style={{ color: 'white' }}>{val}</span>
}
];
const data = [
{
key: '1',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '2',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '3',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '4',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '5',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '6',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '7',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '8',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '9',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '10',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '11',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '12',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '13',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '14',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '15',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '16',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '17',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '18',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '19',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '20',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '21',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '22',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '23',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '225',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '25',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '26',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '27',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '28',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
},
{
key: '29',
kmmc: '消防技能培训',
pxsj: '2019-01-01',
cjrs: 10,
'0-60': 4,
'61-85': '3',
'86-100': '3',
dbl: '60%'
}
];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/**
* 安全培训右侧
*/
class SafteyRight extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 10
};
this.state = {
data: [],
loading: false,
equimentId: null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList: [],
totalCount: 0,
searchParam: '',
fname: '',
current: 1,
pageSize: 10,
total: 0,
tableHeight: 450
};
}
componentDidMount() {
const { pagination } = this.state;
var box1 = document.getElementById('fire-bottom-left');
var box2 = document.getElementById('one-div');
if (box1 && box2) {
//此处在加一层判断,更加严密,如果box存在的情况下获取
console.log(box1.offsetHeight);
console.log(box2.offsetHeight);
this.setState({
tableHeight: box1.offsetHeight - box2.offsetHeight
});
}
}
onEdit = id => {
// this.type = 'edit';
// electricFireDetailsAction(id).then(d => {
// this.setState({
// form: d,
// title: d.name
// })
// })
console.log('id:' + id);
this.setState({
data: data,
totalCount: data.length
});
};
onChange = (value, item) => {
console.log(value, item);
};
onTimeChange = (value, dateString) => {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
};
onOk = value => {
console.log('onOk: ', value);
};
onChangeSelect = (value, item) => {
console.log(value, item);
};
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () => {
// this.setState({
// data:data
// })
};
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData = () => {
let name = this.state.fname;
alert(name);
};
onChange = (e, value) => {
this.setState({ fname: value });
};
getPanelHeight = () => {
// //计算表格高度
// var box1=document.getElementById("fire-bottom-right");
// if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
// return box1.offsetHeight * 0.91;
// }
return 300;
};
SearchChange = value => {
alert(value);
};
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01' : 'back-02';
return className;
};
render() {
let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state;
let { pagination, isChecked, fname, data, totalCount, selectedRowKeys } = this.state;
return (
<div className="fire-bottom-right" id="fire-bottom-right">
<div className="fire-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
/>
</div>
</div>
</div>
);
}
}
SafteyRight.propTypes = {};
export default SafteyRight;
...@@ -2,7 +2,6 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,6 @@ import React, { Component } from 'react';
import SafteyLeft from './SafteyLeft'; import SafteyLeft from './SafteyLeft';
import SafteyRight from './SafteyRight'; import SafteyRight from './SafteyRight';
/** /**
* 安全培训 * 安全培训
*/ */
...@@ -14,15 +13,14 @@ export default class Safety extends Component { ...@@ -14,15 +13,14 @@ export default class Safety extends Component {
}; };
} }
componentDidMount(){ componentDidMount() {
//右侧窗口默认显示第一个数据查询的列表 //右侧窗口默认显示第一个数据查询的列表
this.list && this.list.onRequestTable((list) => this.onEditClick(list[0])) this.list && this.list.onRequestTable(list => this.onEditClick(list[0]));
} }
onEditClick = (record) => { onEditClick = record => {
this.listTwo.onEdit(record.key);
this.listTwo.onEdit(record.key) };
}
render() { render() {
return ( return (
...@@ -30,8 +28,8 @@ export default class Safety extends Component { ...@@ -30,8 +28,8 @@ export default class Safety extends Component {
<div className="fire-safty-content"> <div className="fire-safty-content">
<div className="fire-top"></div> <div className="fire-top"></div>
<div className="fire-bottom"> <div className="fire-bottom">
<SafteyLeft ref={node => this.list = node} onEditClick={this.onEditClick}/> <SafteyLeft ref={node => (this.list = node)} onEditClick={this.onEditClick} />
<SafteyRight ref={node => this.listTwo = node}/> <SafteyRight ref={node => (this.listTwo = node)} />
</div> </div>
</div> </div>
</div> </div>
......
import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts';
import { Table } from 'amos-antd';
import AmosGridTable from './../safetyManage/AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd';
import moment from 'moment';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option;
const Search = Input.Search;
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
align: 'center', // 设置文本居中的属性
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '换流站名称',
width: '20%',
dataIndex: 'name',
render: val => <span style={{color:"yellow"}}>{val}</span>,
},
{
title: '装备类型',
width: '10%',
dataIndex: 'zblx',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '累计保养',
width: '10%',
dataIndex: 'ljby',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '保养中',
width: '10%',
dataIndex: 'byz',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: <div className='safe-table-title-font-red'>逾期保养</div>,
width: '20%',
dataIndex: 'yqby',
render: val => <span style={{color:"red"}}>{val}</span>,
},
{
title: <div className='safe-table-title-font-red'>逾期占比</div>,
width: '20%',
dataIndex: 'yqzb',
render: val => <span style={{color:"red"}}>{val}</span>,
}
];
const data = [
{
key: '1',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '2',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '3',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '4',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '5',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '6',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '7',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '8',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '9',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '10',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '11',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '12',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '13',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '14',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '15',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '16',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '17',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '18',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '19',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '20',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '21',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '22',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '23',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '225',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '25',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '26',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '27',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '28',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
},
{
key: '29',
name: '复龙换流站',
zblx: 9,
ljby:170,
byz: 100,
yqby:20,
yqzb:'16.7%'
}
];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/**
* 器材保养左侧
*/
class EquipmentMaintainLeft extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 14
};
this.state = {
data: [],
loading: false,
equimentId:null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList:[],
totalCount:0,
searchParam:'',
fname:'',
current: 1,
pageSize: 10,
total: 0,
tableHeight:450
};
}
componentDidMount() {
const { pagination } = this.state;
var box1=document.getElementById("equipmentMaintain-bottom-left");
var box2=document.getElementById("one-div");
if(box1 && box2){ //此处在加一层判断,更加严密,如果box存在的情况下获取
console.log(box1.offsetHeight);
console.log(box2.offsetHeight);
this.setState({
tableHeight:(box1.offsetHeight-box2.offsetHeight)
})
}
}
onRequestTable = (callback) => {
this.setState({
data:data,
totalCount:data.length
});
callback && callback(data);
// electricFireListAction(current, pageSize, searchName).then(d => {
// const { dataList, total } = d || {};
// });
}
onChange = (value, item) =>{
console.log(value, item);
}
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
}
onOk=(value) =>{
console.log('onOk: ', value);
}
onChangeSelect = (value, item) =>{
console.log(value, item);
}
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () =>{
this.setState({
data:data
})
}
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData =()=>{
let name = this.state.fname;
alert(name)
}
onChange = (e,value) =>{
this.setState({ fname: value });
}
getPanelHeight = () => {
//计算表格高度
var box1=document.getElementById("equipmentMaintain-bottom-left");
if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
return box1.offsetHeight * 0.91
}
};
SearchChange = (value) => {
alert(value)
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
render() {
let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state;
const {onEditClick} =this.props;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state;
return (
<div className="equipmentMaintain-bottom-left" id="equipmentMaintain-bottom-left">
<div className="equipmentMaintain-bottom-left-content">
<div className="one-div" id="one-div">
<div className="search-one">
{/* <div className="search-one-button" onClick={this.searchData} /> */}
<div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} />
</div>
</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
onRowClick={(record) => onEditClick(record)}
/>
</div>
</div>
</div>
);
}
}
EquipmentMaintainLeft.propTypes = {
};
export default EquipmentMaintainLeft;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tabs } from 'amos-antd'; import { Tabs } from 'amos-antd';
const { TabPane} = Tabs;
const { TabPane } = Tabs;
/** /**
* 消防实力统计详情 * 消防实力统计详情
*/ */
class FireStrengthDetail extends Component { class FireStrengthDetail extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -17,14 +14,9 @@ class FireStrengthDetail extends Component { ...@@ -17,14 +14,9 @@ class FireStrengthDetail extends Component {
}; };
} }
componentDidMount() { componentDidMount() {}
}
render() { render() {
return ( return (
<div className="fire-strength-detail"> <div className="fire-strength-detail">
<Tabs defaultactivekey="1" type="card"> <Tabs defaultactivekey="1" type="card">
...@@ -43,8 +35,6 @@ class FireStrengthDetail extends Component { ...@@ -43,8 +35,6 @@ class FireStrengthDetail extends Component {
} }
} }
FireStrengthDetail.propTypes = { FireStrengthDetail.propTypes = {};
};
export default FireStrengthDetail; export default FireStrengthDetail;
...@@ -3,16 +3,6 @@ import PropTypes from 'prop-types'; ...@@ -3,16 +3,6 @@ import PropTypes from 'prop-types';
import { sessionConsts } from '../../consts/storageConsts'; import { sessionConsts } from '../../consts/storageConsts';
import { Store } from 'amos-tool'; import { Store } from 'amos-tool';
import Header from './../main/header'; import Header from './../main/header';
import loadScripts from 'dt2react/lib/utils/loadScripts';
import { outMap } from './../../consts/urlConsts';
import { Modal, Select } from 'amos-framework';
import RiskControlTable from './../monitor/statistical/RiskControlTable';
import DangerControlTable from './../monitor/statistical/DangerControlTable';
import AlarmControlTable from './../monitor/statistical/AlarmControlTable';
import CenterLevelLeft from './../monitor/statistical/indexLeft';
import CenterLevelRight from './../monitor/statistical/indexRight';
const lsTool = Store.lsTool; const lsTool = Store.lsTool;
...@@ -27,13 +17,8 @@ class RootView extends Component { ...@@ -27,13 +17,8 @@ class RootView extends Component {
super(props); super(props);
this.state = { this.state = {
submenu: [], submenu: [],
extendSystem: [], extendSystem: []
loadAmap: false,
BasicMap: null,
visible1: false,
visible2: false,
visible3: false,
flag:false,
}; };
} }
...@@ -41,114 +26,23 @@ class RootView extends Component { ...@@ -41,114 +26,23 @@ class RootView extends Component {
let systemMenu = []; let systemMenu = [];
let systemMenus = JSON.parse(lsTool.read(sessionConsts.systemMenu)); let systemMenus = JSON.parse(lsTool.read(sessionConsts.systemMenu));
systemMenus.map(e =>{ systemMenus.map(e =>{
if(e.permissionName && e.permissionName !=="消防安全管理" && e.permissionName !=="消防实力情况" ){ if (e.permissionName && e.permissionName !== '消防安全管理' && e.permissionName !== '消防实力情况' ){
systemMenu.push(e) systemMenu.push(e);
} }
}) });
this.setState({ extendSystem: systemMenu }); this.setState({ extendSystem: systemMenu });
} }
componentDidMount() { componentDidMount() {
if (outMap) {
Object.keys(localStorage).map(e => {
if (e.indexOf('_AMap') === 0) {
localStorage.removeItem(e);
}
});
let script = null;
let mainUI = null;
script = {
key: 'amapscripts',
//url: `//172.16.3.121:8085/extra/amap/js/outamap.1.4.6.js?rnd= ${Math.random()}`
url: `/extra/amap/js/outamap.1.4.6.js?rnd= ${Math.random()}`
};
mainUI = {
key: 'mainUI',
//url: '//10.56.28.228/webapi.amap.com/ui/1.0/main.js'
url: '/extra/amap/js/outmain.1.4.6.js'
};
loadScripts.asyncLoadScript(script, () => {
loadScripts.asyncLoadScript(mainUI, () => {
setTimeout(() => {
this.setState({
loadAmap: true,
BasicMap: require('./mapScreen/BasicMap')
});
}, 2000);
});
});
} else {
this.setState({
loadAmap: true,
BasicMap: require('./mapScreen/BasicMap')
});
}
} }
componentWillUnmount() { componentWillUnmount() {
} }
cancel = () => {
this.setState({
visible1: false,
visible2: false,
visible3: false,
flag:true,
});
}
getContext = (type) => {
const { flag } = this.state;
if(type==='1'){
return <RiskControlTable refresh={flag}/>;
}else if(type==='2'){
return <DangerControlTable refresh={flag} />;
}else if(type==='3'){
return <AlarmControlTable refresh={flag} />;
}
};
ondetails = (type) => {
if(type==='1'){
this.setState({
visible1: true
});
}else if(type==='2'){
this.setState({
visible2: true
});
}else{
this.setState({
visible3: true
});
}
};
render() { render() {
const { visible1,visible2,visible3,flag } = this.state;
let type1="1";
let type2="2";
let type3="3";
const { children } = this.props; const { children } = this.props;
let BasicMap = this.state.BasicMap;
return ( return (
<div className="view-root"> <div className="view-root">
<div className="header"> <div className="header">
...@@ -156,51 +50,7 @@ class RootView extends Component { ...@@ -156,51 +50,7 @@ class RootView extends Component {
</div> </div>
<div className="content-body"> <div className="content-body">
{children} {children}
{ this.state.loadAmap && <BasicMap />}
</div> </div>
<CenterLevelLeft ondetails={ this.ondetails } />
<CenterLevelRight />
<Modal
header="风险管控情况"
visible={visible1}
className="risk-model-model99"
width={'50%'}
noDefaultFooter
content={ this.getContext(type1)}
onCancel={ this.cancel}
destroyOnClose={true}
/>
<Modal
header="隐患管控情况"
visible={visible2}
className="risk-model-model99"
width={'50%'}
noDefaultFooter
content={ this.getContext(type2)}
onCancel={ this.cancel }
destroyOnClose={true}
/>
<Modal
header="告警管控情况"
visible={visible3}
className="risk-model-model99"
width={'50%'}
noDefaultFooter
content={this.getContext(type3)}
onCancel={ this.cancel}
destroyOnClose={true}
/>
</div> </div>
); );
} }
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/**
* MapScreen
* 地图
* @class MapScreen
* @extends {Component}
*/
class MapScreen extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillMount() {
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<div className="map-root">
</div>
);
}
}
MapScreen.propTypes = {
};
export default MapScreen;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/**
* regulate
*安全监管
* @class regulate
* @extends {Component}
*/
class Regulate extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillMount() {
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<div className="duty-root">
</div>
);
}
}
Regulate.propTypes = {
};
export default Regulate;
import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts';
import { Table } from 'amos-antd';
import AmosGridTable from './AmosGridTable';
import { Input, Button } from 'amos-antd';
import { DatePicker } from 'amos-antd';
import moment from 'moment';
import dt2react from 'dt2react';
const dateFormatList = ['DD/MM/YYYY', 'DD/MM/YY'];
const { RangePicker } = DatePicker;
const dateFormat = 'YYYY/MM/DD';
const monthFormat = 'YYYY/MM';
import { Select } from 'amos-framework';
const Option = Select.Option;
const Search = Input.Search;
const columns = [
{
title: '序号',
dataIndex: 'key',
width: '10%',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '科目名称',
width: '15%',
dataIndex: 'kmmc',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '培训时间',
width: '15%',
dataIndex: 'pxsj',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: '参加人数',
width: '10%',
dataIndex: 'cjrs',
render: val => <span style={{color:"white"}}>{val}</span>,
},
{
title: <div className = "safe-table-title-font-red-right">0-60</div>,
width: '10%',
dataIndex: '0-60',
render: val => <span style={{color:"red"}}>{val}</span>,
},
{
title:<div className = "safe-table-title-font-yellow">61-85</div>,
width: '10%',
dataIndex: '61-85',
render: val => <span style={{color:"yellow"}}>{val}</span>,
},
{
title: <div className = "safe-table-title-font-green" style ={{paddingTop:"5% !important"}}>86-100</div>,
width: '10%',
dataIndex: '86-100',
render: val => <span style={{color:"green"}}>{val}</span>,
}
,
{
title: '达标率%',
width: '10%',
dataIndex: 'dbl',
render: val => <span style={{color:"white"}}>{val}</span>,
}
];
const data = [
{
key: '1',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '2',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '3',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '4',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '5',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '6',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '7',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '8',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '9',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '10',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '11',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '12',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '13',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '14',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '15',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '16',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '17',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '18',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '19',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '20',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '21',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '22',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '23',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '225',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '25',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '26',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '27',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '28',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
},
{
key: '29',
kmmc: '消防技能培训',
pxsj: "2019-01-01",
cjrs:10,
"0-60": 4,
'61-85':'3',
'86-100':"3",
dbl:"60%"
}
];
const selectdata = [
{ id: 0, name: '消防理论知识培训' },
{ id: 1, name: '消防技能培训' },
{ id: 3, name: '设备器材维护管理' },
{ id: 4, name: '火灾隐患管理' },
{ id: 5, name: '用火用电管理' }
];
//偏移
const offsetHeight = 110;
const defaultHeight = 450;
/**
* 安全培训右侧
*/
class SafteyRight extends Component {
constructor(props) {
super(props);
this.pageConfig = {
current: 1,
pageSize: 10
};
this.state = {
data: [],
loading: false,
equimentId:null,
pagination: true,
isChecked: false,
selectedRows: [],
selectedRowKeys: [],
dataList: [],
newDataList:[],
totalCount:0,
searchParam:'',
fname:'',
current: 1,
pageSize: 10,
total: 0,
tableHeight:450
};
}
componentDidMount() {
const { pagination } = this.state;
var box1=document.getElementById("fire-bottom-left");
var box2=document.getElementById("one-div");
if(box1 && box2){ //此处在加一层判断,更加严密,如果box存在的情况下获取
console.log(box1.offsetHeight);
console.log(box2.offsetHeight);
this.setState({
tableHeight:(box1.offsetHeight-box2.offsetHeight)
})
}
}
onEdit = (id) => {
// this.type = 'edit';
// electricFireDetailsAction(id).then(d => {
// this.setState({
// form: d,
// title: d.name
// })
// })
console.log("id:" + id)
this.setState({
data:data,
totalCount:data.length
})
}
onChange = (value, item) =>{
console.log(value, item);
}
onTimeChange= (value, dateString)=> {
console.log('Selected Time: ', value);
console.log('Formatted Selected Time: ', dateString);
}
onOk=(value) =>{
console.log('onOk: ', value);
}
onChangeSelect = (value, item) =>{
console.log(value, item);
}
reload = r => {
this.setState(
{
reload: () => {
r();
this.setState({ selectedRows: [], selectedRowKeys: [] });
}
},
r()
);
};
getAcitonData = () =>{
// this.setState({
// data:data
// })
}
/**
* 分页设置参数
*/
setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize;
}
if (current !== undefined) {
this.pageConfig.pageNumber = current;
}
};
/**
* 获取表格所选则的行数据
*/
getSelectedRows = (selectedRows, selectedRowKeys) => {
this.setState({ selectedRows, selectedRowKeys });
let { riskSourceId, equipmentId, callBack } = this.props;
// callBack(selectedRowKeys,riskSourceId,equipmentId);
};
searchData =()=>{
let name = this.state.fname;
alert(name)
}
onChange = (e,value) =>{
this.setState({ fname: value });
}
getPanelHeight = () => {
// //计算表格高度
// var box1=document.getElementById("fire-bottom-right");
// if(box1){ //此处在加一层判断,更加严密,如果box存在的情况下获取
// return box1.offsetHeight * 0.91;
// }
return 300
};
SearchChange = (value) => {
alert(value)
}
rowClassName = (record, index) => {
let className = index % 2 ? 'back-01': 'back-02';
return className
}
render() {
let defaultPageConfig = this.pageConfig;
const { current, pageSize, total } = this.state;
let { pagination, isChecked, fname,data,totalCount,selectedRowKeys } = this.state;
return (
<div className="fire-bottom-right" id="fire-bottom-right">
<div className="fire-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<AmosGridTable
columns={columns}
dataList={data}
isPageable={pagination}
totals={totalCount}
callBack={this.reload}
selectedRowKeys={selectedRowKeys}
getSelectedRows={this.getSelectedRows}
getTableDataAction={this.getAcitonData}
isChecked={isChecked}
setPageConfig={this.setPageConfig}
defaultPageConfig={defaultPageConfig}
getPanelHeight={this.getPanelHeight}
rowClassName={this.rowClassName}
/>
</div>
</div>
</div>
);
}
}
SafteyRight.propTypes = {
};
export default SafteyRight;
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import { Modal } from 'amos-framework';
import AlarmControlTable from './AlarmControlTable';
/** /**
* 告警管控 * 告警管控
*/ */
export default class AlarmControl extends Component { export default class AlarmControl extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
seriesData:[], seriesData: [],
hj:0, hj: 0,
gz:0, gz: 0,
xj:0 xj: 0,
visible: false
}; };
} }
componentDidMount(){ componentDidMount() {
let dates = [
let dates=[ { value: 3, name: '火警告警' },
{value:3, name:'火警告警'}, { value: 31, name: '故障告警' },
{value:31, name:'故障告警'}, { value: 10, name: '巡检告警' }
{value:10, name:'巡检告警'}, ];
];
if(dates){
this.setState({ seriesData: dates,hj:dates[0].value,gz:dates[1].value,xj:dates[2].value});
}
if (dates) {
this.setState({ seriesData: dates, hj: dates[0].value, gz: dates[1].value, xj: dates[2].value });
}
} }
//获取告警管控数据
ondetails = (type) => {
this.props.ondetails("3");
};
//获取告警管控数据
getOptionsx = () => { getOptionsx = () => {
const { seriesData } = this.state; const { seriesData } = this.state;
return { return {
color: ['rgba(243, 12, 12, 1)', 'rgba(219, 121, 23, 1)', 'rgba(209, 209, 52, 1)'],
color:['rgba(243, 12, 12, 1)','rgba(219, 121, 23, 1)','rgba(209, 209, 52, 1)'],
series: [ series: [
{ {
name: "", name: '',
type: "pie", type: 'pie',
radius: ["0%", "55%"], radius: ['0%', '55%'],
center: ["50%", "50%"], center: ['50%', '50%'],
label: { label: {
show: false show: false
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(24,219,159,0.1)' color: 'rgba(24,219,159,0.1)'
}, }
}, },
hoverAnimation: false, hoverAnimation: false,
data: [100] data: [100]
}, },
{ {
name:'检查点', name: '检查点',
type:'pie', type: 'pie',
radius: ['60%', '72%'], radius: ['60%', '72%'],
center: ['50%', '50%'], center: ['50%', '50%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -85,89 +67,98 @@ if(dates){ ...@@ -85,89 +67,98 @@ if(dates){
let total = 0; let total = 0;
seriesData.forEach(e => { seriesData.forEach(e => {
total += e.value; total += e.value;
}) });
var view = '{val|' +total + '}\n{name|' + '告警总数' + '}'; var view = '{val|' + total + '}\n{name|' + '告警总数' + '}';
return view; return view;
}, },
textStyle: { textStyle: {
rich: { rich: {
name: { name: {
fontSize: 12, fontSize: 12,
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color:'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)'
}, },
val: { val: {
fontSize: 20, fontSize: 20,
fontWeight: 'bold', fontWeight: 'bold',
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)'
}
} }
} }
} }
},
}, },
labelLine: { labelLine: {
normal: { normal: {
show: false show: false
} }
}, },
data:seriesData data: seriesData
} }
] ]
}; };
} };
open = () => {
this.setState({ visible: true });
};
cancel = () => {
this.setState({ visible: false });
};
render() { render() {
const { hj,gz,xj } = this.state; const { hj, gz, xj, visible } = this.state;
return ( return (
<div className="AlarmControl"> <div className="AlarmControl">
<div className="AlarmControl_1"> <div className="AlarmControl_1">
<div className="AlarmControl_1_1"><span>告警管控情况</span></div> <div className="AlarmControl_1_1">
<span>告警管控情况</span>
</div>
</div> </div>
<div className="AlarmControl_2"> <div className="AlarmControl_2">
<div className="AlarmControl_2_1" onClick={this.ondetails}> </div> <div className="AlarmControl_2_1" onClick={()=>this.open()} />
<Modal
header="告警管控情况"
visible={visible}
className="risk-model-model99"
width={'50%'}
dragable
noDefaultFooter
content={<AlarmControlTable />}
onCancel={this.cancel}
destroyOnClose
/>
<div className="AlarmControl_2_2"> <div className="AlarmControl_2_2">
<div className="AlarmControl_2_2_1"> <div className="AlarmControl_2_2_1">
<div className="AlarmControl8"> <div className="AlarmControl8">
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12"> 火警告警:</div> <div className="AlarmControl2_12"> 火警告警:</div>
<div className="AlarmControl2_13">{hj}</div> <div className="AlarmControl2_13">{hj}</div>
</div> </div>
<div className="AlarmControl2_2"></div> <div className="AlarmControl2_2" />
</div> </div>
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12">故障告警:</div> <div className="AlarmControl2_12">故障告警:</div>
<div className="AlarmControl2_13">{gz}</div> <div className="AlarmControl2_13">{gz}</div>
</div> </div>
<div className="AlarmControl2_3"></div> <div className="AlarmControl2_3" />
</div> </div>
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1" > <div className="AlarmControl2_1">
<div className="AlarmControl2_12">巡检告警:</div> <div className="AlarmControl2_12">巡检告警:</div>
<div className="AlarmControl2_13">{xj}</div> <div className="AlarmControl2_13">{xj}</div>
</div> </div>
<div className="AlarmControl2_4"></div> <div className="AlarmControl2_4" />
</div> </div>
</div> </div>
</div> </div>
<div className="AlarmControl_2_2_2"> <div className="AlarmControl_2_2_2">
<ReactEcharts option={this.getOptionsx()} />
<ReactEcharts option = { this.getOptionsx() } />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
); );
} }
} }
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Form, Select, Radio,StdForm ,Icon,AmosAlert} from 'amos-framework'; import { Form, Select, Radio, StdForm, Icon, AmosAlert } from 'amos-framework';
import { TreeSelect, DatePicker } from 'amos-antd'; import { TreeSelect, DatePicker } from 'amos-antd';
import { Input } from 'amos-antd'; import { Input } from 'amos-antd';
import moment from 'moment'; import moment from 'moment';
...@@ -12,84 +9,76 @@ import { SingleTable } from 'amos-pro'; ...@@ -12,84 +9,76 @@ import { SingleTable } from 'amos-pro';
const FormItem = Form.Item; const FormItem = Form.Item;
const Search = Input.Search; const Search = Input.Search;
const tableList1 = [ const tableList1 = [
{ name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } { name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const tableList2 = [ const tableList2 = [
{ name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const data = [ const data = [
{ id: 0, name: '失控' }, { id: 0, name: '失控' },
{ id: 1, name: '受控' } { id: 1, name: '受控' }
]; ];
const checkInputColumns = (_this) => { const checkInputColumns = _this => {
return [ return [
{ {
title: '换流站', title: '换流站',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '20%', width: '20%',
query: true, query: true
}, },
{ {
title: <div style={{"color":"#0055FF"}}>火警告警</div>, title: <div style={{ color: '#0055FF' }}>火警告警</div>,
dataIndex: 'sex', dataIndex: 'sex',
key: 'sex', key: 'sex',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="yi">{text}</p> ; // return <p className="yi">{text}</p> ;
// } // }
}, },
{ {
title: <div style={{"color":"#F1F10C"}}>火警告警</div>, title: <div style={{ color: '#F1F10C' }}>火警告警</div>,
dataIndex: 'age', dataIndex: 'age',
key: 'age', key: 'age',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="er">{text}</p> ; // return <p className="er">{text}</p> ;
// } // }
}, },
{ {
title: <div style={{"color":"#FF8000"}}>巡检告警</div>, title: <div style={{ color: '#FF8000' }}>巡检告警</div>,
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="san">{text}</p> ; // return <p className="san">{text}</p> ;
...@@ -116,9 +105,8 @@ const data = [ ...@@ -116,9 +105,8 @@ const data = [
st: 'text', //搜索的类型 st: 'text', //搜索的类型
width: '20%' width: '20%'
} }
]; ];
}; };
/** /**
* 风险管控详情 * 风险管控详情
...@@ -135,31 +123,26 @@ class AlarmControlTable extends Component { ...@@ -135,31 +123,26 @@ class AlarmControlTable extends Component {
totals: 0, //所有数据总和 totals: 0, //所有数据总和
reload() {}, reload() {},
maxHeight: 650, maxHeight: 650,
name:"", name: '',
startTime: moment().format('YYYY-MM-DD'), startTime: moment().format('YYYY-MM-DD'),
endTime: moment().add(1, "years").format('YYYY-MM-DD'), endTime: moment()
.add(1, 'years')
.format('YYYY-MM-DD')
}; };
} }
componentWillMount = () => { componentWillMount = () => {
this.setState({ dataList: tableList1 });
this.setState({ dataList:tableList1}); this.setState({ totals: 13 });
this.setState({ totals:13});
};
componentDidMount = () => {
}; };
componentWillReceiveProps = (nextProps) => { componentDidMount = () => {};
} componentWillReceiveProps = nextProps => {};
SearchChange = (value) => {
alert(value)
}
SearchChange = value => {
alert(value);
};
/** /**
* 获取表格刷新方法 * 获取表格刷新方法
...@@ -177,56 +160,42 @@ class AlarmControlTable extends Component { ...@@ -177,56 +160,42 @@ class AlarmControlTable extends Component {
//搜索 //搜索
onIconClick1 = () => { onIconClick1 = () => {
this.setState({ dataList: tableList2 });
this.setState({ totals: 5 });
};
this.setState({ dataList:tableList2}); componentWillReceiveProps = nextProps => {
this.setState({ totals:5}); if (nextProps.refresh) {
} this.setState({ name: '' });
componentWillReceiveProps = (nextProps) => {
if (nextProps.refresh){
this.setState({ name:"" });
this.setState({ startTime: moment().format('YYYY-MM-DD')});
this.setState({ endTime:moment().add(1, "years").format('YYYY-MM-DD') });
this.setState({ startTime: moment().format('YYYY-MM-DD') });
this.setState({
endTime: moment()
.add(1, 'years')
.format('YYYY-MM-DD')
});
} }
}
fillCheckInputTable = param => {
}; };
onChange1 = (e, value) => {
this.setState({ name:value });
} fillCheckInputTable = param => {};
onChange1 = (e, value) => {
this.setState({ name: value });
};
onChange = (key, value) => { onChange = (key, value) => {
if (key === 'name') {
if(key==='name'){ this.setState({ name: value });
this.setState({ name:value }); } else if (key === 'startTime') {
}else if(key==='startTime'){ this.setState({ startTime: moment(value).format('YYYY-MM-DD') });
this.setState({ startTime: moment(value).format('YYYY-MM-DD')}); } else {
}else{
this.setState({ endTime: moment(value).format('YYYY-MM-DD') }); this.setState({ endTime: moment(value).format('YYYY-MM-DD') });
} }
};
}
render() { render() {
const { dataList, totals, name, endTime, startTime } = this.state;
const { dataList,totals ,name,endTime,startTime} = this.state;
return ( return (
<div className="souh" > <div className="souh">
<div className="sou"> <div className="sou">
<div className="search-one-alarm"> <div className="search-one-alarm">
{/* <div className="search-one-button" onClick={this.searchData} /> */} {/* <div className="search-one-button" onClick={this.searchData} /> */}
...@@ -234,8 +203,6 @@ class AlarmControlTable extends Component { ...@@ -234,8 +203,6 @@ class AlarmControlTable extends Component {
{/* <Search value={name} className="input_item_select" icon={<Icon icon='search' onClick={ this.onIconClick1} />} onChange={ this.onChange1} /> */} {/* <Search value={name} className="input_item_select" icon={<Icon icon='search' onClick={ this.onIconClick1} />} onChange={ this.onChange1} /> */}
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
<div className="search-three-alarm"> <div className="search-three-alarm">
<span className="three-font">&nbsp;&nbsp;日期:&nbsp;&nbsp;</span> <span className="three-font">&nbsp;&nbsp;日期:&nbsp;&nbsp;</span>
...@@ -243,33 +210,31 @@ class AlarmControlTable extends Component { ...@@ -243,33 +210,31 @@ class AlarmControlTable extends Component {
format="YYYY-MM-DD" format="YYYY-MM-DD"
value={moment(startTime)} value={moment(startTime)}
className="input_item_select" className="input_item_select"
onChange={(value2) => { this.onChange('startTime', value2); }} onChange={value2 => {
this.onChange('startTime', value2);
}}
allowClear={false} allowClear={false}
/> />
{/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */} {/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */}
&nbsp;&nbsp;<font style={{color:'#5FFFFD'}}></font>&nbsp;&nbsp; &nbsp;&nbsp;<font style={{ color: '#5FFFFD' }}></font>&nbsp;&nbsp;
<DatePicker <DatePicker
format="YYYY-MM-DD" format="YYYY-MM-DD"
value={moment(endTime)} value={moment(endTime)}
className="input_item_select" className="input_item_select"
onChange={(value3) => { this.onChange('endTime', value3); }} onChange={value3 => {
this.onChange('endTime', value3);
}}
allowClear={false} allowClear={false}
/> />
</div> </div>
</div> </div>
<div className="inputxqtable"> <div className="inputxqtable">
<InputTable <InputTable
columns={checkInputColumns(this)} columns={checkInputColumns(this)}
callBack={this.reload} callBack={this.reload}
dataSource={dataList} dataSource={dataList}
totals={totals} totals={totals}
getTableDataAction={this.fillCheckInputTable} getTableDataAction={this.fillCheckInputTable}
/> />
</div> </div>
</div> </div>
...@@ -277,6 +242,4 @@ class AlarmControlTable extends Component { ...@@ -277,6 +242,4 @@ class AlarmControlTable extends Component {
} }
} }
export default AlarmControlTable; export default AlarmControlTable;
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import echarts from 'echarts/lib/echarts';
//import { AllSafetyAction } from './../../../services/centerLevelService';
/** /**
* 总体消防安全情况 * 总体消防安全情况
*/ */
const option = { const option = {
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: "{a} <br/>{b}: {c} ({d}%)" formatter: '{a} <br/>{b}: {c} ({d}%)'
}, },
// color: ['#00CACE', '#F70D0E'],
color: ['#F70D0E', '#00CACE'], color: ['#F70D0E', '#00CACE'],
graphic: [{ //环形图中间添加文字 graphic: [
{
//环形图中间添加文字
type: 'text', //通过不同top值可以设置上下显示 type: 'text', //通过不同top值可以设置上下显示
left: 'center', left: 'center',
top: '30%', top: '30%',
style: { style: {
text: '80', //'80' + '\n' + '总数' text: '80', //'80' + '\n' + '总数'
textAlign: 'center', textAlign: 'center',
fill: "rgba(255,255,255,1)", //文字的颜色 fill: 'rgba(255,255,255,1)', //文字的颜色
width: 30, width: 30,
height: 30, height: 30,
fontSize: 25, fontSize: 25,
fontFamily: "Microsoft YaHei", fontFamily: 'Microsoft YaHei',
fontWeight:"bold" fontWeight: 'bold'
} }
}, },
{ //环形图中间添加文字 {
//环形图中间添加文字
type: 'text', //通过不同top值可以设置上下显示 type: 'text', //通过不同top值可以设置上下显示
left: 'center', left: 'center',
top: '45%', top: '45%',
style: { style: {
text: '站点', text: '站点',
textAlign: 'center', textAlign: 'center',
fill: "rgba(255,255,255,1)", //文字的颜色 fill: 'rgba(255,255,255,1)', //文字的颜色
width: 24, width: 24,
height: 16, height: 16,
fontSize: 12, fontSize: 12,
fontFamily: "Microsoft YaHei", fontFamily: 'Microsoft YaHei',
fontWeight:400 fontWeight: 400
}
} }
}], ],
series: [ series: [
{ {
...@@ -67,30 +62,26 @@ const option = { ...@@ -67,30 +62,26 @@ const option = {
data: [ data: [
{ {
value: 40, value: 40,
name: "不合格", name: '不合格'
}, },
{ {
value: 60, value: 60,
name: '正常', name: '正常'
} }
] ]
}, },
{ {
name: "中间的背景", name: '中间的背景',
type: "pie", type: 'pie',
radius: ["0%", "60%"], radius: ['0%', '60%'],
center: ["50%", "40%"], center: ['50%', '40%'],
label: { label: {
show: false show: false
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(24,219,159,0.1)' color: 'rgba(24,219,159,0.1)'
}, }
}, },
//隐藏多余文字提示 //隐藏多余文字提示
label: { label: {
...@@ -109,9 +100,7 @@ const option = { ...@@ -109,9 +100,7 @@ const option = {
] ]
}; };
class AllSafety extends Component { class AllSafety extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -119,25 +108,15 @@ class AllSafety extends Component { ...@@ -119,25 +108,15 @@ class AllSafety extends Component {
}; };
} }
componentDidMount() { componentDidMount() {}
}
getOptionsx = () => { getOptionsx = () => {
return option; return option;
} };
render() { render() {
return ( return (
<div className="AllSafety"> <div className="AllSafety">
<div className="all-safety-content"> <div className="all-safety-content">
<div className="all-safety-font">总体消防安全情况</div> <div className="all-safety-font">总体消防安全情况</div>
<div className="content-detail"> <div className="content-detail">
...@@ -149,31 +128,27 @@ class AllSafety extends Component { ...@@ -149,31 +128,27 @@ class AllSafety extends Component {
<div className="right-one-font">1</div> <div className="right-one-font">1</div>
</div> </div>
<div className="all-safety-right-two"> <div className="all-safety-right-two">
<div className="right-two-font"><span className="jiantou">&darr;</span>-1</div> <div className="right-two-font">
<span className="jiantou">&darr;</span>-1
</div>
</div> </div>
<div className="all-safety-right-three"> <div className="all-safety-right-three">
<div className="right-three-font">1</div> <div className="right-three-font">1</div>
</div> </div>
<div className="all-safety-right-four"> <div className="all-safety-right-four">
<div className="right-four-font"><span className="jiantou">&uarr;</span>+1</div> <div className="right-four-font">
<span className="jiantou">&uarr;</span>+1
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{/* <ReactEcharts option={this.getOptionsx(map)} className='echart-week' /> */} {/* <ReactEcharts option={this.getOptionsx(map)} className='echart-week' /> */}
</div> </div>
); );
} }
} }
AllSafety.propTypes = {};
AllSafety.propTypes = {
};
export default AllSafety; export default AllSafety;
import React, { Component } from 'react'; import React, { Component } from 'react';
import imgStatic from './../../../consts/imgStatic'; import { Modal } from 'amos-framework';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
const centerLevelIcon = imgStatic.centerLevelIcon; import DangerControlTable from './DangerControlTable';
/** /**
* 隐患管控 * 隐患管控
*/ */
export default class DangerControl extends Component { export default class DangerControl extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
seriesData: [], seriesData: [],
yq:0, yq: 0,
sw:0, sw: 0,
zl:0, zl: 0,
jd:'0%' jd: '0%',
visible: false
}; };
} }
componentDidMount(){ componentDidMount() {
let dates = {
let dates={jd:'20%', jd: '20%',
seriesData: [ seriesData: [
{value:35, name:'逾期未治理'}, { value: 35, name: '逾期未治理' },
{value:10, name:'尚未治理'}, { value: 10, name: '尚未治理' },
{value:4, name:'治理验收'}, { value: 4, name: '治理验收' }
]
]}; };
if(dates){ if (dates) {
this.setState({ seriesData: dates.seriesData,jd:dates.jd,yq:dates.seriesData[0].value,sw:dates.seriesData[1].value,zl:dates.seriesData[2].value}); this.setState({
seriesData: dates.seriesData,
jd: dates.jd,
yq: dates.seriesData[0].value,
sw: dates.seriesData[1].value,
zl: dates.seriesData[2].value
});
} }
} }
ondetails = (type) => {
this.props.ondetails("2");
};
getOptionsx = () => { getOptionsx = () => {
const { seriesData } = this.state;
const { seriesData} = this.state;
return { return {
color: ['rgba(254, 0, 0, 1)', 'rgba(255, 214, 0, 1)', 'rgba(0, 255, 238, 1)'],
color:['rgba(254, 0, 0, 1)','rgba(255, 214, 0, 1)','rgba(0, 255, 238, 1)'],
series: [ series: [
{ {
name: "", name: '',
type: "pie", type: 'pie',
radius: ["0%", "55%"], radius: ['0%', '55%'],
center: ["50%", "50%"], center: ['50%', '50%'],
label: { label: {
show: false show: false
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(24,219,159,0.1)' color: 'rgba(24,219,159,0.1)'
}, }
}, },
hoverAnimation: false, hoverAnimation: false,
data: [100] data: [100]
}, },
{ {
name:'检查点', name: '检查点',
type:'pie', type: 'pie',
radius: ['60%', '72%'], radius: ['60%', '72%'],
center: ['50%', '50%'], center: ['50%', '50%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -82,59 +78,70 @@ export default class DangerControl extends Component { ...@@ -82,59 +78,70 @@ export default class DangerControl extends Component {
let total = 0; let total = 0;
seriesData.forEach(e => { seriesData.forEach(e => {
total += e.value; total += e.value;
}) });
var view = '{val|' +total + '}\n{name|' + '隐患总数' + '}'; var view = '{val|' + total + '}\n{name|' + '隐患总数' + '}';
return view; return view;
}, },
textStyle: { textStyle: {
rich: { rich: {
name: { name: {
fontSize: 12, fontSize: 12,
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color:'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)'
}, },
val: { val: {
fontSize: 20, fontSize: 20,
fontWeight: 'bold', fontWeight: 'bold',
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color: 'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)'
}
} }
} }
} }
},
}, },
labelLine: { labelLine: {
normal: { normal: {
show: false show: false
} }
}, },
data:seriesData data: seriesData
} }
] ]
}; };
} };
open = () => {
this.setState({ visible: true });
};
cancel = () => {
this.setState({ visible: false });
};
render() { render() {
const { yq,sw,zl,jd} = this.state; const { yq, sw, zl, jd, visible } = this.state;
return ( return (
<div className='DangerControl'> <div className="DangerControl">
<div className="DangerControl_1"> <div className="DangerControl_1">
<div className="DangerControl_1_1"><span>隐患管控情况</span></div> <div className="DangerControl_1_1">
<span>隐患管控情况</span>
</div>
</div> </div>
<div className="DangerControl_2"> <div className="DangerControl_2">
<div className="DangerControl_2_1" onClick={this.ondetails}></div> <div className="DangerControl_2_1" onClick={this.open} />
<Modal
header="隐患管控情况"
visible={visible}
className="risk-model-model99"
width={'50%'}
dragable
noDefaultFooter
content={<DangerControlTable refresh />}
onCancel={this.cancel}
destroyOnClose
/>
<div className="DangerControl_2_2"> <div className="DangerControl_2_2">
<div className="DangerControl_2_2_1"> <div className="DangerControl_2_2_1">
<div className="AlarmControl8"> <div className="AlarmControl8">
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12"> 逾期未治理:</div> <div className="AlarmControl2_12"> 逾期未治理:</div>
<div className="AlarmControl2_13">{yq}</div> <div className="AlarmControl2_13">{yq}</div>
</div> </div>
...@@ -142,7 +149,6 @@ export default class DangerControl extends Component { ...@@ -142,7 +149,6 @@ export default class DangerControl extends Component {
</div> </div>
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12">尚未治理:</div> <div className="AlarmControl2_12">尚未治理:</div>
<div className="AlarmControl2_13">{sw}</div> <div className="AlarmControl2_13">{sw}</div>
</div> </div>
...@@ -150,7 +156,6 @@ export default class DangerControl extends Component { ...@@ -150,7 +156,6 @@ export default class DangerControl extends Component {
</div> </div>
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12">治理验收:</div> <div className="AlarmControl2_12">治理验收:</div>
<div className="AlarmControl2_13">{zl}</div> <div className="AlarmControl2_13">{zl}</div>
</div> </div>
...@@ -158,21 +163,18 @@ export default class DangerControl extends Component { ...@@ -158,21 +163,18 @@ export default class DangerControl extends Component {
</div> </div>
<div className="AlarmControl2"> <div className="AlarmControl2">
<div className="AlarmControl2_1"> <div className="AlarmControl2_1">
<div className="AlarmControl2_12">治理进度:</div> <div className="AlarmControl2_12">治理进度:</div>
<div className="AlarmControl2_13">{jd}</div> <div className="AlarmControl2_13">{jd}</div>
</div> </div>
<div className="AlarmControl2_6"></div> <div className="AlarmControl2_6"></div>
</div> </div>
</div> </div>
</div> </div>
<div className="DangerControl_2_2_2"> <div className="DangerControl_2_2_2">
<ReactEcharts option = { this.getOptionsx() } /> <ReactEcharts option={this.getOptionsx()} />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
); );
} }
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Form, Select, Radio,StdForm ,Icon,AmosAlert} from 'amos-framework'; import { Form, Select, Radio, StdForm, Icon, AmosAlert } from 'amos-framework';
import { Input } from 'amos-antd'; import { Input } from 'amos-antd';
import { TreeSelect, DatePicker } from 'amos-antd'; import { TreeSelect, DatePicker } from 'amos-antd';
import moment from 'moment'; import moment from 'moment';
...@@ -10,50 +10,44 @@ const FormItem = Form.Item; ...@@ -10,50 +10,44 @@ const FormItem = Form.Item;
const Option = Select.Option; const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
const tableList1 = [ const tableList1 = [
{ id: '1', name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } { id: '1', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const tableList2 = [ const tableList2 = [
{ id: '1', name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const data = [ const data = [
{ id: 1, name: '严重' }, { id: 1, name: '严重' },
{ id: 2, name: '一般' } { id: 2, name: '一般' }
]; ];
const checkInputColumns = (_this) => { const checkInputColumns = _this => {
return [ return [
{ {
title: '换流站', title: '换流站',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '20%', width: '20%',
query: true, query: true
}, },
{ {
title: '已治理', title: '已治理',
...@@ -61,14 +55,11 @@ const data = [ ...@@ -61,14 +55,11 @@ const data = [
key: 'sex', key: 'sex',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="yi">{text}</p> ; // return <p className="yi">{text}</p> ;
// } // }
}, },
{ {
title: '未治理', title: '未治理',
...@@ -76,12 +67,11 @@ const data = [ ...@@ -76,12 +67,11 @@ const data = [
key: 'age', key: 'age',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="er">{text}</p> ; // return <p className="er">{text}</p> ;
// } // }
}, },
{ {
title: '逾期未治理', title: '逾期未治理',
...@@ -89,7 +79,7 @@ const data = [ ...@@ -89,7 +79,7 @@ const data = [
key: 'address', key: 'address',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true //是否是默认显示的
// render: (text,record) => { // render: (text,record) => {
// return <p className="san">{text}</p> ; // return <p className="san">{text}</p> ;
...@@ -101,7 +91,7 @@ const data = [ ...@@ -101,7 +91,7 @@ const data = [
key: 'id', key: 'id',
query: true, query: true,
required: true, //是否是默认显示的 required: true, //是否是默认显示的
width: '15%', width: '15%'
// render: (text,record) => { // render: (text,record) => {
// return <p className="si">{text}</p> ; // return <p className="si">{text}</p> ;
...@@ -116,9 +106,8 @@ const data = [ ...@@ -116,9 +106,8 @@ const data = [
st: 'text', //搜索的类型 st: 'text', //搜索的类型
width: '20%' width: '20%'
} }
]; ];
}; };
/** /**
* 风险管控详情 * 风险管控详情
...@@ -135,28 +124,23 @@ class DangerControlTable extends Component { ...@@ -135,28 +124,23 @@ class DangerControlTable extends Component {
totals: 0, //所有数据总和 totals: 0, //所有数据总和
reload() {}, reload() {},
maxHeight: 650, maxHeight: 650,
name:"", name: '',
startTime: moment().format('YYYY-MM-DD'), startTime: moment().format('YYYY-MM-DD'),
endTime: moment().add(1, "years").format('YYYY-MM-DD'), endTime: moment()
grade:"" .add(1, 'years')
.format('YYYY-MM-DD'),
grade: ''
}; };
} }
componentWillMount = () => { componentWillMount = () => {
this.setState({ dataList: tableList1 });
this.setState({ dataList:tableList1}); this.setState({ totals: 13 });
this.setState({ totals:13});
};
componentDidMount = () => {
}; };
componentWillReceiveProps = (nextProps) => { componentDidMount = () => {};
}
componentWillReceiveProps = nextProps => {};
/** /**
* 获取表格刷新方法 * 获取表格刷新方法
...@@ -172,64 +156,52 @@ class DangerControlTable extends Component { ...@@ -172,64 +156,52 @@ class DangerControlTable extends Component {
); );
}; };
SearchChange = (value) => { SearchChange = value => {
alert(value) alert(value);
} };
//搜索 //搜索
onIconClick1 = () => { onIconClick1 = () => {
this.setState({ dataList: tableList2 });
this.setState({ totals: 5 });
};
this.setState({ dataList:tableList2}); componentWillReceiveProps = nextProps => {
this.setState({ totals:5}); debugger;
} if (nextProps.refresh) {
this.setState({ name: '' });
componentWillReceiveProps = (nextProps) => {
debugger
if (nextProps.refresh){
this.setState({ name:"" });
this.setState({ startTime: moment().format('YYYY-MM-DD')});
this.setState({ endTime:moment().add(1, "years").format('YYYY-MM-DD') });
this.setState({ grade: "" });
this.setState({ startTime: moment().format('YYYY-MM-DD') });
this.setState({
endTime: moment()
.add(1, 'years')
.format('YYYY-MM-DD')
});
this.setState({ grade: '' });
} }
}
fillCheckInputTable = param => {
}; };
onChange1 = (e, value) => {
this.setState({ name:value });
} fillCheckInputTable = param => {};
onChange1 = (e, value) => {
this.setState({ name: value });
};
onChange = (key, value) => { onChange = (key, value) => {
if (key === 'name') {
if(key==='name'){ this.setState({ name: value });
this.setState({ name:value }); } else if (key === 'startTime') {
}else if(key==='startTime'){ this.setState({ startTime: moment(value).format('YYYY-MM-DD') });
this.setState({ startTime: moment(value).format('YYYY-MM-DD')}); } else if (key === 'endTime') {
}else if(key==='endTime'){
this.setState({ endTime: moment(value).format('YYYY-MM-DD') }); this.setState({ endTime: moment(value).format('YYYY-MM-DD') });
}else{ } else {
this.setState({ grade: value }); this.setState({ grade: value });
} }
};
}
render() { render() {
const { dataList, totals, name, grade, endTime, startTime } = this.state;
const { dataList,totals ,name,grade,endTime,startTime} = this.state;
return ( return (
<div className="souh" > <div className="souh">
<div className="sou"> <div className="sou">
<div className="search-one"> <div className="search-one">
{/* <div className="search-one-button" onClick={this.searchData} /> */} {/* <div className="search-one-button" onClick={this.searchData} /> */}
...@@ -237,21 +209,17 @@ class DangerControlTable extends Component { ...@@ -237,21 +209,17 @@ class DangerControlTable extends Component {
{/* <Search value={name} className="input_item_select" icon={<Icon icon='search' onClick={ this.onIconClick1} />} onChange={ this.onChange1} /> */} {/* <Search value={name} className="input_item_select" icon={<Icon icon='search' onClick={ this.onIconClick1} />} onChange={ this.onChange1} /> */}
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
<div className="search-two" > <div className="search-two">
<Select
className="search-select-style"
<Select className="search-select-style"
data={data} data={data}
value={grade} value={grade}
renderOption={item => <Option value={item.id}>{item.name}</Option>} renderOption={item => <Option value={item.id}>{item.name}</Option>}
onChange={(value4) => { this.onChange('grade', value4); }} onChange={value4 => {
this.onChange('grade', value4);
}}
/> />
</div> </div>
<div className="search-three"> <div className="search-three">
<span className="three-font">日期:&nbsp;&nbsp;</span> <span className="three-font">日期:&nbsp;&nbsp;</span>
...@@ -259,33 +227,31 @@ class DangerControlTable extends Component { ...@@ -259,33 +227,31 @@ class DangerControlTable extends Component {
format="YYYY-MM-DD" format="YYYY-MM-DD"
value={moment(startTime)} value={moment(startTime)}
className="input_item_select" className="input_item_select"
onChange={(value2) => { this.onChange('startTime', value2); }} onChange={value2 => {
this.onChange('startTime', value2);
}}
allowClear={false} allowClear={false}
/> />
{/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */} {/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */}
&nbsp;&nbsp;<font style={{color:'#5FFFFD'}}></font>&nbsp;&nbsp; &nbsp;&nbsp;<font style={{ color: '#5FFFFD' }}></font>&nbsp;&nbsp;
<DatePicker <DatePicker
value={moment(endTime)} value={moment(endTime)}
format="YYYY-MM-DD" format="YYYY-MM-DD"
className="input_item_select" className="input_item_select"
onChange={(value3) => { this.onChange('endTime', value3); }} onChange={value3 => {
this.onChange('endTime', value3);
}}
allowClear={false} allowClear={false}
/> />
</div> </div>
</div> </div>
<div className="inputxqtable"> <div className="inputxqtable">
<InputTable <InputTable
columns={checkInputColumns(this)} columns={checkInputColumns(this)}
callBack={this.reload} callBack={this.reload}
dataSource={dataList} dataSource={dataList}
totals={totals} totals={totals}
getTableDataAction={this.fillCheckInputTable} getTableDataAction={this.fillCheckInputTable}
/> />
</div> </div>
</div> </div>
...@@ -293,6 +259,4 @@ class DangerControlTable extends Component { ...@@ -293,6 +259,4 @@ class DangerControlTable extends Component {
} }
} }
export default DangerControlTable; export default DangerControlTable;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Store } from 'amos-tool';
import { sessionConsts } from './../../../consts/storageConsts'; import { sessionConsts } from './../../../consts/storageConsts';
import { browerSupport, consts, Store, LocationParam } from 'amos-tool';
const lsTool = Store.lsTool;
const lsTool = Store.lsTool;
/** /**
* 消防安全管理 * 消防安全管理
*/ */
class FireSafety extends Component { class FireSafety extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -20,107 +14,77 @@ class FireSafety extends Component { ...@@ -20,107 +14,77 @@ class FireSafety extends Component {
}; };
} }
componentDidMount() { componentDidMount() {}
} onClick = () => {
let sbm = null;
onClick = () =>{
let sbm = null
let systemMenu = JSON.parse(lsTool.read(sessionConsts.systemMenu)) || []; let systemMenu = JSON.parse(lsTool.read(sessionConsts.systemMenu)) || [];
systemMenu.map(e =>{ systemMenu.map(e => {
if(e.permissionName && e.permissionName==="消防安全管理" ){ if (e.permissionName && e.permissionName === '消防安全管理') {
sbm = e; sbm = e;
} }
}) });
if(sbm!==null){ if (sbm !== null) {
window.localStorage.setItem('submenu',JSON.stringify(sbm.children)); window.localStorage.setItem('submenu', JSON.stringify(sbm.children));
}
} }
};
// handleData = (data) => {
// let map = new Map();
// if (data && data.length > 0) {
// data.map(item => {
// map.set(item.name, item.value);
// })
// }
// return map;
// }
render() { render() {
return ( return (
<div className="FireSafety"> <div className="FireSafety">
<div className="fire-safety-content"> <div className="fire-safety-content">
<div className="fire-safety-font">消防安全管理(累计)</div> <div className="fire-safety-font">消防安全管理(累计)</div>
<div className="fire-safety-tongji" > <div className="fire-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-yjya'></span> <span className="titleIcon-yjya"></span>
</div> </div>
<span className='fire-safety-wenzi'>应急预案</span> <span className="fire-safety-wenzi">应急预案</span>
<span className="right-font">100</span> <span className="right-font">100</span>
</div> </div>
</div> </div>
<div className="fire-safety-tongji"> <div className="fire-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-aqpx' ></span> <span className="titleIcon-aqpx"></span>
</div> </div>
<span className='fire-safety-wenzi'>安全培训</span> <span className="fire-safety-wenzi">安全培训</span>
<span className="right-font">123</span> <span className="right-font">123</span>
</div> </div>
</div> </div>
<div className="fire-safety-tongji"> <div className="fire-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-rcxl' ></span> <span className="titleIcon-rcxl"></span>
</div> </div>
<span className='fire-safety-wenzi'>日常训练</span> <span className="fire-safety-wenzi">日常训练</span>
<span className="right-font">100</span> <span className="right-font">100</span>
</div> </div>
</div> </div>
<div className="fire-safety-tongji"> <div className="fire-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-qcby'></span> <span className="titleIcon-qcby"></span>
</div> </div>
<span className='fire-safety-wenzi'>器材保养</span> <span className="fire-safety-wenzi">器材保养</span>
<span className="right-font">14445</span> <span className="right-font">14445</span>
</div> </div>
</div> </div>
<div className="fire-safety-tongji"> <div className="fire-safety-tongji">
<div className="content-tongji"> <div className="content-tongji">
<div className="left-div"> <div className="left-div">
<span className='titleIcon-aqxj' ></span> <span className="titleIcon-aqxj"></span>
</div> </div>
<span className='fire-safety-wenzi'>安全巡检</span> <span className="fire-safety-wenzi">安全巡检</span>
<span className="right-font">800</span> <span className="right-font">800</span>
</div> </div>
</div> </div>
{/**分割线 */}
</div> </div>
</div> </div>
); );
} }
} }
FireSafety.propTypes = {};
FireSafety.propTypes = {
};
export default FireSafety; export default FireSafety;
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal } from 'amos-framework'; import { Modal } from 'amos-framework';
import FireStrengthDetail from'./../firestrength/FireStrengthDetail'; import { Store } from 'amos-tool';
import FireStrengthDetail from './../firestrength/FireStrengthDetail';
import { sessionConsts } from './../../../consts/storageConsts'; import { sessionConsts } from './../../../consts/storageConsts';
import {Store, } from 'amos-tool';
const lsTool = Store.lsTool; const lsTool = Store.lsTool;
/** /**
* 消防实力统计 * 消防实力统计
*/ */
class FireStrength extends Component { class FireStrength extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -18,113 +17,78 @@ class FireStrength extends Component { ...@@ -18,113 +17,78 @@ class FireStrength extends Component {
}; };
} }
componentDidMount() { componentDidMount() {}
} onClick = () => {
let sbm = null;
onClick = () =>{
let sbm = null
let systemMenu = JSON.parse(lsTool.read(sessionConsts.systemMenu)) || []; let systemMenu = JSON.parse(lsTool.read(sessionConsts.systemMenu)) || [];
systemMenu.map(e =>{ systemMenu.map(e => {
if(e.permissionName && e.permissionName==="消防实力情况" ){ if (e.permissionName && e.permissionName === '消防实力情况') {
sbm = e; sbm = e;
} }
}) });
if(sbm!==null){ if (sbm !== null) {
window.localStorage.setItem('submenu',JSON.stringify(sbm.children)); window.localStorage.setItem('submenu', JSON.stringify(sbm.children));
}
} }
};
render() { render() {
return ( return (
<div className="FireStrength"> <div className="FireStrength">
{/* <FireStrengthDetail /> */}
<div className="strength-safety-content"> <div className="strength-safety-content">
<div className="strength-safety-font">消防实力情况(累计) </div> <div className="strength-safety-font">消防实力情况(累计) </div>
<div className="strength-safety-tongji">
{/* <div className="item" style={{marginTop:"0%"}} onClick={this.onClick} >
<div className="item-content"> <div className="item-img-div"><img className="item-img"src='/src/assets/homePage/xfsl/zzxfd.png'/></div><span>驻站消防队:</span><span className="item-value">18支</span> </div>
</div>
<div className="item">
<div className="item-content"> <div className="item-img-div"><img className="item-img"src='/src/assets/homePage/xfsl/zzxfy.png'/></div><span>驻站消防员:</span><span className="item-value">300人</span> </div>
</div>
<div className="item">
<div className="item-content"> <div className="item-img-div"><img className="item-img"src='/src/assets/homePage/xfsl/znzs.png'/></div><span>站内值守:</span><span className="item-value">200人</span> </div>
</div>
<div className="item">
<div className="item-content"> <div className="item-img-div"><img className="item-img"src='/src/assets/homePage/xfsl/xfc.png'/></div><span>消防车:</span><span className="item-value">50辆</span> </div>
</div>
<div className="item">
<div className="item-content"> <div className="item-img-div"> <img className="item-img"src='/src/assets/homePage/xfsl/xfqc.png'/></div><span>消防器材:</span><span className="item-value">20000件</span> </div>
</div> */}
<div className="strength-safety-tongji" >
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-zzxfd'></span> <span className="titleIcon-zzxfd"></span>
</div> </div>
<span className='strength-safety-wenzi'>驻站消防队</span> <span className="strength-safety-wenzi">驻站消防队</span>
<span className="right-font">100</span> <span className="right-font">100</span>
</div> </div>
</div> </div>
<div className="strength-safety-tongji"> <div className="strength-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-zzxfy' ></span> <span className="titleIcon-zzxfy"></span>
</div> </div>
<span className='strength-safety-wenzi'>驻站消防员</span> <span className="strength-safety-wenzi">驻站消防员</span>
<span className="right-font">123</span> <span className="right-font">123</span>
</div> </div>
</div> </div>
<div className="strength-safety-tongji"> <div className="strength-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-znzs' ></span> <span className="titleIcon-znzs"></span>
</div> </div>
<span className='strength-safety-wenzi'>站内值守</span> <span className="strength-safety-wenzi">站内值守</span>
<span className="right-font">100</span> <span className="right-font">100</span>
</div> </div>
</div> </div>
<div className="strength-safety-tongji"> <div className="strength-safety-tongji">
<div className="content-tongji" onClick={this.onClick}> <div className="content-tongji" onClick={this.onClick}>
<div className="left-div"> <div className="left-div">
<span className='titleIcon-xfc'></span> <span className="titleIcon-xfc"></span>
</div> </div>
<span className='strength-safety-wenzi'>消防车</span> <span className="strength-safety-wenzi">消防车</span>
<span className="right-font">14445</span> <span className="right-font">14445</span>
</div> </div>
</div> </div>
<div className="strength-safety-tongji"> <div className="strength-safety-tongji">
<div className="content-tongji"> <div className="content-tongji">
<div className="left-div"> <div className="left-div">
<span className='titleIcon-xfqc' ></span> <span className="titleIcon-xfqc"></span>
</div> </div>
<span className='strength-safety-wenzi'>消防器材</span> <span className="strength-safety-wenzi">消防器材</span>
<span className="right-font">800</span> <span className="right-font">800</span>
</div> </div>
</div> </div>
</div> </div>
<Modal <Modal width={1000} height={1000} content={<FireStrengthDetail />} visible={false}></Modal>
width={1000}
height={1000}
content={<FireStrengthDetail/>}
visible={false}
></Modal>
</div> </div>
); );
} }
} }
FireStrength.propTypes = { FireStrength.propTypes = {};
};
export default FireStrength; export default FireStrength;
...@@ -13,12 +13,12 @@ class InputTable extends Component { ...@@ -13,12 +13,12 @@ class InputTable extends Component {
pageSize: props.outterPageConfig ? props.outterPageConfig.pageSize : 10 pageSize: props.outterPageConfig ? props.outterPageConfig.pageSize : 10
}; };
this.state = { this.state = {
loading: false,//页面是否加载中,默认false loading: false, //页面是否加载中,默认false
dataList: [],//表格数据集合 dataList: [], //表格数据集合
size: 'middle',//表格大小 size: 'middle', //表格大小
current: props.defaultPageConfig ? props.defaultPageConfig.current : 1,//当前页初始索引0 current: props.defaultPageConfig ? props.defaultPageConfig.current : 1, //当前页初始索引0
pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10,//当前页数据量 pageSize: props.defaultPageConfig ? props.defaultPageConfig.pageSize : 10, //当前页数据量
totals: 1,//所有数据总和 totals: 1, //所有数据总和
maxHeight: 250 maxHeight: 250
}; };
} }
...@@ -36,9 +36,9 @@ class InputTable extends Component { ...@@ -36,9 +36,9 @@ class InputTable extends Component {
window.removeEventListener('resize', this.onWindowResize); window.removeEventListener('resize', this.onWindowResize);
} }
onWindowResize = (e) => { onWindowResize = e => {
this.getHeightOffset(); this.getHeightOffset();
} };
/** /**
* 设置页面数据大小事件 * 设置页面数据大小事件
...@@ -46,56 +46,57 @@ class InputTable extends Component { ...@@ -46,56 +46,57 @@ class InputTable extends Component {
onSizeChange = (current, pageSize) => { onSizeChange = (current, pageSize) => {
let { setPageConfig } = this.props; let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current, pageSize }); setPageConfig && setPageConfig({ current, pageSize });
this.setState({ current, pageSize },this.reload); this.setState({ current, pageSize }, this.reload);
} };
/** /**
* 设置当前页事件 * 设置当前页事件
*/ */
onPaginationChange = (current) => { onPaginationChange = current => {
let { setPageConfig } = this.props; let { setPageConfig } = this.props;
setPageConfig && setPageConfig({ current }); setPageConfig && setPageConfig({ current });
this.setState({ current },this.reload); this.setState({ current }, this.reload);
} };
setPageConfig = ({ pageSize,current }) => { setPageConfig = ({ pageSize, current }) => {
if (pageSize !== undefined) { if (pageSize !== undefined) {
this.pageConfig.pageSize = pageSize; this.pageConfig.pageSize = pageSize;
} }
if (current !== undefined) { if (current !== undefined) {
this.pageConfig.current = current; this.pageConfig.current = current;
} }
} };
/** /**
* 获取表格数据(刷新) * 获取表格数据(刷新)
*/ */
reload = () => { reload = () => {
let { current,pageSize } = this.state;
// this.props.getTableDataAction({ current: current - 1, pageSize });
// this.getHeightOffset();
}
showTotal = (total) => { };
showTotal = total => {
return `共 ${total} 条`; return `共 ${total} 条`;
} };
generateRowkey = (record, index) => { generateRowkey = (record, index) => {
return record.id ? record.id : index + (this.state.current - 1) * this.state.pageSize; return record.id ? record.id : index + (this.state.current - 1) * this.state.pageSize;
} };
getHeightOffset = () => { getHeightOffset = () => {
let { getPanelHeight } = this.props; let { getPanelHeight } = this.props;
let height = getPanelHeight === undefined ? '850' : getPanelHeight(); let height = getPanelHeight === undefined ? '850' : getPanelHeight();
height && this.setState({ maxHeight: height }); height && this.setState({ maxHeight: height });
} };
render() { render() {
let { size, loading, maxHeight } = this.state; let { size, loading, maxHeight } = this.state;
let { columns, dataSource, totals, pagination } = this.props; let { columns, dataSource, totals, pagination } = this.props;
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
let rowKey = this.generateRowkey; let rowKey = this.generateRowkey;
let _tempPagination = pagination === false ? false : pagination || { let _tempPagination =
pagination === false
? false
: pagination || {
size: 'small', size: 'small',
total: totals, total: totals,
current: this.state.current, current: this.state.current,
......
...@@ -3,9 +3,7 @@ import { RiskControlDetailAction } from './../../../services/centerLevelService' ...@@ -3,9 +3,7 @@ import { RiskControlDetailAction } from './../../../services/centerLevelService'
import moment from 'moment'; import moment from 'moment';
const format = 'YYYY-MM-dd'; const format = 'YYYY-MM-dd';
export default class ModelContent extends Component { export default class ModelContent extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -13,25 +11,25 @@ export default class ModelContent extends Component { ...@@ -13,25 +11,25 @@ export default class ModelContent extends Component {
}; };
} }
componentDidMount(){ componentDidMount() {
let { type } = this.props; let { type } = this.props;
this.RiskControlDetail(type); this.RiskControlDetail(type);
} }
RiskControlDetail = (type) => { RiskControlDetail = type => {
RiskControlDetailAction(type).then(data => { RiskControlDetailAction(type).then(data => {
this.setState({ this.setState({
alarmData: data alarmData: data
}); });
}); });
} };
/** /**
* 获取标题 * 获取标题
* *
* @memberof ModelContent * @memberof ModelContent
*/ */
getTitle = (v) => { getTitle = v => {
const titleParams = { const titleParams = {
1: '一级风险点', //一级风险点 1: '一级风险点', //一级风险点
2: '二级风险点', //二级风险点 2: '二级风险点', //二级风险点
...@@ -39,39 +37,39 @@ export default class ModelContent extends Component { ...@@ -39,39 +37,39 @@ export default class ModelContent extends Component {
4: '四级风险点' //四级风险点 4: '四级风险点' //四级风险点
}; };
return titleParams[v]; return titleParams[v];
} };
formatData = (str) => { formatData = str => {
let date = str.split(' ')[0]; let date = str.split(' ')[0];
return date; return date;
} };
renderContent = (content) =>{ renderContent = content => {
return ( return (
<div className='rows'> <div className="rows">
{(content || []).map(itemA => { {(content || []).map(itemA => {
return ( return (
<div className='row'> <div className="row">
<span>{itemA.name}</span> <span>{itemA.name}</span>
<span className='date'>{this.formatData(itemA.changeDate)}</span> <span className="date">{this.formatData(itemA.changeDate)}</span>
</div> </div>
); );
})} })}
</div> </div>
); );
} };
render() { render() {
let { alarmData } = this.state; let { alarmData } = this.state;
let { type } = this.props; let { type } = this.props;
return ( return (
<div className='model-content'> <div className="model-content">
{(alarmData || []).map(item => { {(alarmData || []).map(item => {
return ( return (
<div className='content-div'> <div className="content-div">
<div className='title'> <div className="title">
<span>|</span> <span>|</span>
<span className='next-title'>{ type === 'risk' ? this.getTitle(item.typeCode) : item.typeName }</span> <span className="next-title">{type === 'risk' ? this.getTitle(item.typeCode) : item.typeName}</span>
</div> </div>
{this.renderContent(item.content)} {this.renderContent(item.content)}
</div> </div>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactEcharts from 'amos-viz/lib/echarts'; import ReactEcharts from 'amos-viz/lib/echarts';
import { Modal } from 'amos-framework';
import RiskControlTable from './../../monitor/statistical/RiskControlTable';
/** /**
* 风险管控 * 风险管控
*/ */
export default class RiskControl extends Component { export default class RiskControl extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
seriesData:[], seriesData: [],
shikong:0, shikong: 0,
shoukongx:'0%', shoukongx: '0%',
shikongx:'0%', shikongx: '0%',
shoukong:0, shoukong: 0,
yiji:0, yiji: 0,
erji:0, erji: 0,
sanji:0, sanji: 0,
siji:0 siji: 0,
visible: false
}; };
} }
componentDidMount() { componentDidMount() {
let dates = {
let dates={ seriesData: [
seriesData:[ { value: 3, name: '受控' },
{value:3, name:'受控'}, { value: 7, name: '失控' }
{value:7, name:'失控'},
], ],
yiji:10, yiji: 10,
erji:20, erji: 20,
sanji:30, sanji: 30,
siji:40, siji: 40,
shoukongx:'30%', shoukongx: '30%',
shikongx:'70%' shikongx: '70%'
}; };
if(dates){ if (dates) {
this.setState({ seriesData: dates.seriesData, this.setState({
yiji:dates.yiji, seriesData: dates.seriesData,
erji:dates.erji, yiji: dates.yiji,
sanji:dates.sanji, erji: dates.erji,
siji:dates.siji, sanji: dates.sanji,
shoukongx:dates.shoukongx, siji: dates.siji,
shikongx:dates.shikongx, shoukongx: dates.shoukongx,
shoukong:dates.seriesData[0].value,shikong:dates.seriesData[1].value}); shikongx: dates.shikongx,
shoukong: dates.seriesData[0].value,
shikong: dates.seriesData[1].value
});
} }
} }
ondetails = (type) => {
this.props.ondetails("1");
};
getOptionsx = () => { getOptionsx = () => {
const { seriesData } = this.state; const { seriesData } = this.state;
return { return {
color: ['rgba(0, 202, 206, 1)', 'rgba(254, 0, 0, 1)'],
color:['rgba(0, 202, 206, 1)','rgba(254, 0, 0, 1)'],
series: [ series: [
{ {
name: "", name: '',
type: "pie", type: 'pie',
radius: ["0%", "65%"], radius: ['0%', '65%'],
center: ["50%", "50%"], center: ['50%', '50%'],
label: { label: {
show: false show: false
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(24,219,159,0.1)' color: 'rgba(24,219,159,0.1)'
}, }
}, },
hoverAnimation: false, hoverAnimation: false,
data: [100] data: [100]
}, },
{ {
name:'检查点', name: '检查点',
type:'pie', type: 'pie',
radius: ['70%', '85%'], radius: ['70%', '85%'],
center: ['50%', '50%'], center: ['50%', '50%'],
avoidLabelOverlap: false, avoidLabelOverlap: false,
...@@ -99,52 +88,67 @@ export default class RiskControl extends Component { ...@@ -99,52 +88,67 @@ export default class RiskControl extends Component {
let total = 0; let total = 0;
seriesData.forEach(e => { seriesData.forEach(e => {
total += e.value; total += e.value;
}) });
var view = '{val|' +total + '}\n{name|' + '风险总数' + '}'; var view = '{val|' + total + '}\n{name|' + '风险总数' + '}';
return view; return view;
}, },
textStyle: { textStyle: {
rich: { rich: {
name: { name: {
fontSize: 12, fontSize: 12,
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color:'rgba(255,255,255,1)', color: 'rgba(255,255,255,1)'
}, },
val: { val: {
fontSize: 20, fontSize: 20,
fontWeight: 'bold', fontWeight: 'bold',
fontFamily:'Microsoft YaHei', fontFamily: 'Microsoft YaHei',
color: 'rgba(0,255,238,1)', color: 'rgba(0,255,238,1)'
}
} }
} }
} }
},
}, },
labelLine: { labelLine: {
normal: { normal: {
show: false show: false
} }
}, },
data:seriesData data: seriesData
} }
] ]
}; };
} };
open = () => {
this.setState({ visible: true });
};
cancel = () => {
this.setState({ visible: false });
};
render() { render() {
const { shikong,shoukong,shikongx,shoukongx,yiji,erji,sanji,siji} = this.state; const { shikong, shoukong, shikongx, shoukongx, yiji, erji, sanji, siji, visible } = this.state;
return ( return (
<div className="RiskControl"> <div className="RiskControl">
<div className="RiskControl_1"> <div className="RiskControl_1">
<div className="RiskControl_1_1"><span>风险管控情况</span></div> <div className="RiskControl_1_1">
<span>风险管控情况</span>
</div>
</div> </div>
<div className="RiskControl_2"> <div className="RiskControl_2">
<div className="RiskControl_2_1" onClick={this.ondetails}></div> <div className="RiskControl_2_1" onClick={() => this.open()} />
<Modal
header="风险管控情况"
visible={visible}
dragable
className="risk-model-model99"
width={'50%'}
noDefaultFooter
content={<RiskControlTable refresh />}
onCancel={this.cancel}
destroyOnClose
/>
<div className="RiskControl_2_2"> <div className="RiskControl_2_2">
<div className="RiskControl_2_2_1"> <div className="RiskControl_2_2_1">
<div className="RiskControl_2_2_19"> <div className="RiskControl_2_2_19">
<div className="RiskControl_2_2_191 shi">{shikongx}</div> <div className="RiskControl_2_2_191 shi">{shikongx}</div>
<div className="RiskControl_2_2_192 shi1">失控:{shikong}</div> <div className="RiskControl_2_2_192 shi1">失控:{shikong}</div>
...@@ -153,12 +157,9 @@ export default class RiskControl extends Component { ...@@ -153,12 +157,9 @@ export default class RiskControl extends Component {
<div className="RiskControl_2_2_191 shou">{shoukongx}</div> <div className="RiskControl_2_2_191 shou">{shoukongx}</div>
<div className="RiskControl_2_2_192 shou1">受控:{shoukong}</div> <div className="RiskControl_2_2_192 shou1">受控:{shoukong}</div>
</div> </div>
</div> </div>
<div className="RiskControl_2_2_2"> <div className="RiskControl_2_2_2">
<ReactEcharts option={this.getOptionsx()} />
<ReactEcharts option = { this.getOptionsx() } />
</div> </div>
</div> </div>
</div> </div>
...@@ -168,30 +169,28 @@ export default class RiskControl extends Component { ...@@ -168,30 +169,28 @@ export default class RiskControl extends Component {
<div className="RiskControl_3_1_8">二级:</div> <div className="RiskControl_3_1_8">二级:</div>
<div className="RiskControl_3_1_8">{erji}</div> <div className="RiskControl_3_1_8">{erji}</div>
</div> </div>
<div className="RiskControl_3_1_2"></div> <div className="RiskControl_3_1_2" />
</div> </div>
<div className="RiskControl_3_1"> <div className="RiskControl_3_1">
<div className="RiskControl_3_1_17"> <div className="RiskControl_3_1_17">
<div className="RiskControl_3_1_8"> 一级:</div> <div className="RiskControl_3_1_8"> 一级:</div>
<div className="RiskControl_3_1_8">{yiji}</div> <div className="RiskControl_3_1_8">{yiji}</div>
</div> </div>
<div className="RiskControl_3_1_3"></div> <div className="RiskControl_3_1_3" />
</div> </div>
<div className="RiskControl_3_1"> <div className="RiskControl_3_1">
<div className="RiskControl_3_1_1"> <div className="RiskControl_3_1_1">
<div className="RiskControl_3_1_8">四级:</div> <div className="RiskControl_3_1_8">四级:</div>
<div className="RiskControl_3_1_8">{siji}</div> <div className="RiskControl_3_1_8">{siji}</div>
</div> </div>
<div className="RiskControl_3_1_4"></div> <div className="RiskControl_3_1_4" />
</div> </div>
<div className="RiskControl_3_1"> <div className="RiskControl_3_1">
<div className="RiskControl_3_1_17"> <div className="RiskControl_3_1_17">
<div className="RiskControl_3_1_8">三级:</div> <div className="RiskControl_3_1_8">三级:</div>
<div className="RiskControl_3_1_8">{sanji}</div> <div className="RiskControl_3_1_8">{sanji}</div>
</div> </div>
<div className="RiskControl_3_1_5"></div> <div className="RiskControl_3_1_5" />
</div> </div>
</div> </div>
</div> </div>
......
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Form, Select, Radio,StdForm ,Icon,AmosAlert} from 'amos-framework'; import { Form, Select, Radio, StdForm, Icon, AmosAlert } from 'amos-framework';
import { TreeSelect, DatePicker } from 'amos-antd'; import { TreeSelect, DatePicker } from 'amos-antd';
import { Input, Button } from 'amos-antd'; import { Input, Button } from 'amos-antd';
import moment from 'moment'; import moment from 'moment';
...@@ -14,101 +11,87 @@ const Option = Select.Option; ...@@ -14,101 +11,87 @@ const Option = Select.Option;
const Search = Input.Search; const Search = Input.Search;
const tableList1 = [ const tableList1 = [
{ id: '1', name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { id: '2', name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { id: '3', name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { id: '4', name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { id: '5', name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '6', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '7', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '8', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '9', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '10', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '11', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '12', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '13', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '14', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } , { id: '15', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站', sex: '10', age: 10,age1: 30, address: '10' } { id: '16', name: '复龙换流站', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const tableList2 = [ const tableList2 = [
{ id: '1', name: '复龙换流站1', sex: '10', age: 10,age1: 30, address: '10' } , { id: '1', name: '复龙换流站1', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站2', sex: '10', age: 10,age1: 30, address: '10' } , { id: '2', name: '复龙换流站2', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站3', sex: '10', age: 10,age1: 30, address: '10' } , { id: '3', name: '复龙换流站3', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站4', sex: '10', age: 10,age1: 30, address: '10' } , { id: '4', name: '复龙换流站4', sex: '10', age: 10, age1: 30, address: '10' },
{ id: '1', name: '复龙换流站5', sex: '10', age: 10,age1: 30, address: '10' } , { id: '5', name: '复龙换流站5', sex: '10', age: 10, age1: 30, address: '10' }
]; ];
const data = [ const data = [
{ id: '1', name: '失控' },
{ id: '2', name: '受控' }
];
{ id: "1", name: '失控' }, const checkInputColumns = _this => {
{ id: "2", name: '受控' }
];
const checkInputColumns = (_this) => {
return [ return [
{ {
title: '换流站', title: '换流站',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '20%', width: '20%',
query: true, query: true
}, },
{ {
title: <div style={{"color":"#48E0FF"}}>一级</div>, title: <div style={{ color: '#48E0FF' }}>一级</div>,
dataIndex: 'sex', dataIndex: 'sex',
key: 'sex', key: 'sex',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true, //是否是默认显示的
render: (text,record) => { render: (text, record) => {
return <p className="yi">{text}</p> ; return <p className="yi">{text}</p>;
} }
}, },
{ {
title: <div style={{"color":"#F1F10C"}}>二级</div>, title: <div style={{ color: '#F1F10C' }}>二级</div>,
dataIndex: 'age', dataIndex: 'age',
key: 'age', key: 'age',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true, //是否是默认显示的
render: (text,record) => { render: (text, record) => {
return <p className="er">{text}</p> ; return <p className="er">{text}</p>;
} }
}, },
{ {
title: <div style={{"color":"#FF8000"}}>三级</div>, title: <div style={{ color: '#FF8000' }}>三级</div>,
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: '15%', width: '15%',
query: true, query: true,
required: true, //是否是默认显示的 required: true, //是否是默认显示的
render: (text,record) => { render: (text, record) => {
return <p className="san">{text}</p> ; return <p className="san">{text}</p>;
} }
}, },
{ {
title: <div style={{"color":"#FC2F1E"}}>四级</div>, title: <div style={{ color: '#FC2F1E' }}>四级</div>,
dataIndex: 'id', dataIndex: 'id',
key: 'id', key: 'id',
query: true, query: true,
required: true, //是否是默认显示的 required: true, //是否是默认显示的
width: '15%', width: '15%',
render: (text,record) => { render: (text, record) => {
return <p className="si">{text}</p> ; return <p className="si">{text}</p>;
} }
}, },
{ {
...@@ -120,9 +103,8 @@ const data = [ ...@@ -120,9 +103,8 @@ const data = [
st: 'text', //搜索的类型 st: 'text', //搜索的类型
width: '20%' width: '20%'
} }
]; ];
}; };
/** /**
* 风险管控详情 * 风险管控详情
...@@ -139,38 +121,37 @@ class RiskControlTable extends Component { ...@@ -139,38 +121,37 @@ class RiskControlTable extends Component {
totals: 0, //所有数据总和 totals: 0, //所有数据总和
reload() {}, reload() {},
maxHeight: 650, maxHeight: 650,
name:"", name: '',
startTime: moment().format('YYYY-MM-DD'), startTime: moment().format('YYYY-MM-DD'),
endTime: moment().add(1, "years").format('YYYY-MM-DD'), endTime: moment()
grade:"" .add(1, 'years')
.format('YYYY-MM-DD'),
grade: ''
}; };
} }
componentWillMount = () => { componentWillMount = () => {
this.setState({ dataList: tableList1 });
this.setState({ dataList:tableList1}); this.setState({ totals: 13 });
this.setState({ totals:13});
}; };
componentDidMount = () => { componentDidMount = () => {};
};
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = nextProps => {
if (nextProps.refresh) {
this.setState({ name: '' });
if (nextProps.refresh){ this.setState({ startTime: moment().format('YYYY-MM-DD') });
this.setState({ name:"" });
this.setState({ startTime: moment().format('YYYY-MM-DD')});
this.setState({ endTime:moment().add(1, "years").format('YYYY-MM-DD') });
this.setState({ grade: "" });
this.setState({
endTime: moment()
.add(1, 'years')
.format('YYYY-MM-DD')
});
this.setState({ grade: '' });
} }
} };
/** /**
* 获取表格刷新方法 * 获取表格刷新方法
...@@ -188,125 +169,94 @@ class RiskControlTable extends Component { ...@@ -188,125 +169,94 @@ class RiskControlTable extends Component {
//搜索 //搜索
onIconClick1 = () => { onIconClick1 = () => {
this.setState({ dataList: tableList2 });
this.setState({ totals: 5 });
};
this.setState({ dataList:tableList2}); onOk = value => {
this.setState({ totals:5});
}
onOk=(value) =>{
console.log('onOk: ', value); console.log('onOk: ', value);
}
fillCheckInputTable = param => {
}; };
fillCheckInputTable = param => {};
onChange1 = (e, value) => { onChange1 = (e, value) => {
this.setState({ name:value }); this.setState({ name: value });
};
}
onChange = (key, value) => { onChange = (key, value) => {
if(key==='startTime'){ if (key === 'startTime') {
this.setState({ startTime: moment(value).format('YYYY-MM-DD')}); this.setState({ startTime: moment(value).format('YYYY-MM-DD') });
}else if(key==='endTime'){ } else if (key === 'endTime') {
this.setState({ endTime: moment(value).format('YYYY-MM-DD') }); this.setState({ endTime: moment(value).format('YYYY-MM-DD') });
}else{ } else {
this.setState({ grade: value }); this.setState({ grade: value });
} }
};
} SearchChange = value => {
alert(value);
SearchChange = (value) => { };
alert(value)
}
// renderEndTime(type) {
// debugger
// const { endTime,startTime} = this.state;
// if(type==="1"&&startTime===""){
// return <DatePicker
// format="YYYY-MM-DD"
// className="input_item_select"
// onChange={ e => this.onChange('startTime', e) }
// /> ;
// }else if(type==="1"&&startTime!=""){
// return <DatePicker
// format="YYYY-MM-DD"
// value={moment(startTime)}
// className="input_item_select"
// onChange={ e => this.onChange('startTime', e) }
// /> ;
// }
// if(type==="2"&&endTime===""){
// return <DatePicker
// format="YYYY-MM-DD"
// className="input_item_select"
// onChange={ e => this.onChange('endTime', e) }
// /> ;
// }else if(type==="2"&&endTime!=""){
// return ;
// } // renderEndTime(type) {
// debugger
// const { endTime,startTime} = this.state;
// } // if(type==="1"&&startTime===""){
// return <DatePicker
// format="YYYY-MM-DD"
// className="input_item_select"
// onChange={ e => this.onChange('startTime', e) }
// /> ;
// }else if(type==="1"&&startTime!=""){
// return <DatePicker
// format="YYYY-MM-DD"
// value={moment(startTime)}
// className="input_item_select"
// onChange={ e => this.onChange('startTime', e) }
// /> ;
// }
// if(type==="2"&&endTime===""){
// return <DatePicker
// format="YYYY-MM-DD"
// className="input_item_select"
// onChange={ e => this.onChange('endTime', e) }
// /> ;
// }else if(type==="2"&&endTime!=""){
// return ;
// }
// }
render() { render() {
const { dataList, totals, name, grade, endTime, startTime } = this.state;
const { dataList,totals ,name,grade,endTime,startTime} = this.state;
return ( return (
<div className="souh" > <div className="souh">
<div className="sou"> <div className="sou">
<div className="search-one"> <div className="search-one">
{/* <div className="search-one-button" onClick={this.searchData} /> */} {/* <div className="search-one-button" onClick={this.searchData} /> */}
<div className="search-one-input"> <div className="search-one-input">
<Search placeholder="搜索" onSearch={this.SearchChange} /> <Search placeholder="搜索" onSearch={this.SearchChange} />
</div> </div>
</div> </div>
<div className="search-two" > <div className="search-two">
<Select
className="search-select-style"
<Select className="search-select-style"
data={data} data={data}
value={grade} value={grade}
renderOption={item => <Option value={item.id}>{item.name}</Option>} renderOption={item => <Option value={item.id}>{item.name}</Option>}
onChange={(value4) => { this.onChange('grade', value4); }} onChange={value4 => {
this.onChange('grade', value4);
}}
/> />
</div> </div>
<div className="search-three"> <div className="search-three">
<span className="three-font">日期:&nbsp;&nbsp;</span> <span className="three-font">日期:&nbsp;&nbsp;</span>
...@@ -315,37 +265,31 @@ class RiskControlTable extends Component { ...@@ -315,37 +265,31 @@ class RiskControlTable extends Component {
format="YYYY-MM-DD" format="YYYY-MM-DD"
className="input_item_select" className="input_item_select"
value={moment(startTime)} value={moment(startTime)}
style={{width:'37%'}} style={{ width: '37%' }}
onChange={ e => this.onChange('startTime', e) } onChange={e => this.onChange('startTime', e)}
allowClear={false} allowClear={false}
/> />
{/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */} {/* <DatePicker defaultValue={moment('2015/01/01', dateFormat)} format={dateFormat} /> */}
&nbsp;&nbsp;<font style={{color:'#5FFFFD'}}></font>&nbsp;&nbsp; &nbsp;&nbsp;<font style={{ color: '#5FFFFD' }}></font>&nbsp;&nbsp;
<DatePicker <DatePicker
placeholder="年-月-日" placeholder="年-月-日"
value={moment(endTime)} value={moment(endTime)}
format="YYYY-MM-DD" format="YYYY-MM-DD"
className="input_item_select" className="input_item_select"
onChange={ e => this.onChange('endTime', e)} onChange={e => this.onChange('endTime', e)}
style={{width:'37%'}} style={{ width: '37%' }}
allowClear={false} allowClear={false}
/> />
</div> </div>
</div> </div>
<div className="inputxqtable"> <div className="inputxqtable">
<InputTable <InputTable
columns={checkInputColumns(this)} columns={checkInputColumns(this)}
callBack={this.reload} callBack={this.reload}
dataSource={dataList} dataSource={dataList}
totals={totals} totals={totals}
getTableDataAction={this.fillCheckInputTable} getTableDataAction={this.fillCheckInputTable}
/> />
</div> </div>
</div> </div>
...@@ -353,23 +297,4 @@ class RiskControlTable extends Component { ...@@ -353,23 +297,4 @@ class RiskControlTable extends Component {
} }
} }
export default RiskControlTable; export default RiskControlTable;
import React, { Component } from 'react'; import React, { Component } from 'react';
import AmosWebSocket from 'amos-websocket';
import AlarmControl from './AlarmControl'; import AlarmControl from './AlarmControl';
import DangerControl from './DangerControl'; import DangerControl from './DangerControl';
import RiskControl from './RiskControl'; import RiskControl from './RiskControl';
import AllSafety from './AllSafety'; import AllSafety from './AllSafety';
import FireSafety from './FireSafety'; import FireSafety from './FireSafety';
import FireStrength from './FireStrength'; import FireStrength from './FireStrength';
import AmosWebSocket from 'amos-websocket';
import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts'; import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts';
import { Modal, Select } from 'amos-framework';
/** /**
* 中心级2侧模块 * 中心级2侧模块
*/ */
export default class Statistical extends Component { export default class Statistical extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
visible: true visible: true
}; };
} }
handleData = (data = {}) => { handleData = (data = {}) => {
...@@ -27,8 +23,7 @@ export default class Statistical extends Component { ...@@ -27,8 +23,7 @@ export default class Statistical extends Component {
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
console.log(data); console.log(data);
let refreshType = data.refreshType; let refreshType = data.refreshType;
let content = data.content; switch (refreshType) {
switch (refreshType){
case 'today_safety_index': case 'today_safety_index':
console.log('今日安全指数刷新~~~~~~~~~~~~~~~~~~~~'); console.log('今日安全指数刷新~~~~~~~~~~~~~~~~~~~~');
this.RiskControl.getRiskControl(); this.RiskControl.getRiskControl();
...@@ -66,42 +61,32 @@ export default class Statistical extends Component { ...@@ -66,42 +61,32 @@ export default class Statistical extends Component {
this.FireStrength.FireStrengthData(); this.FireStrength.FireStrengthData();
break; break;
default: default:
console.log(refreshType,':类型不支持'); console.log(refreshType, ':类型不支持');
}
} }
};
cancel = () => { cancel = () => {
this.setState({ this.setState({
visible: false visible: false
}); });
};
}
render() { render() {
const { visible } = this.state;
const wsURL = completeToken(SysWsURL.viewIndexws); const wsURL = completeToken(SysWsURL.viewIndexws);
return ( return (
<div className="statistical"> <div className="statistical">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => (this.aws = node)} url={wsURL} onMessage={this.handleData} reconnect debug />
<div className="statistical-left"> <div className="statistical-left">
<RiskControl ref={node => this.RiskControl = node} /> <RiskControl ref={node => (this.RiskControl = node)} />
<DangerControl ref={node => this.safetyExecute = node} /> <DangerControl ref={node => (this.safetyExecute = node)} />
<AlarmControl ref={node => this.equipStatus = node} /> <AlarmControl ref={node => (this.equipStatus = node)} />
</div> </div>
<div className="statistical-right"> <div className="statistical-right">
<AllSafety ref={node => this.AllSafety = node} /> <AllSafety ref={node => (this.AllSafety = node)} />
<FireSafety ref={node => this.FireSafety = node} /> <FireSafety ref={node => (this.FireSafety = node)} />
<FireStrength ref={node => this.FireStrength = node} /> <FireStrength ref={node => (this.FireStrength = node)} />
</div> </div>
</div> </div>
); );
} }
} }
import React, { Component } from 'react'; import React, { Component } from 'react';
import AmosWebSocket from 'amos-websocket';
import AlarmControl from './AlarmControl'; import AlarmControl from './AlarmControl';
import DangerControl from './DangerControl'; import DangerControl from './DangerControl';
import RiskControl from './RiskControl'; import RiskControl from './RiskControl';
import AmosWebSocket from 'amos-websocket';
import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts'; import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts';
/** /**
...@@ -12,41 +11,20 @@ import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts'; ...@@ -12,41 +11,20 @@ import SysWsURL, { completeToken } from './../../../consts/wsUrlConsts';
export default class StatisticalLeft extends Component { export default class StatisticalLeft extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
}; };
} }
ondetails = (type) => { componentWillMount() {
this.props.ondetails(type);
};
componentWillMount = () => {
};
componentWillReceiveProps = (nextProps) => {
}
}
handleData = (data = {}) => { handleData = (data = {}) => {
console.log('ws data:', data); console.log('ws data:', data);
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
console.log(data); console.log(data);
let refreshType = data.refreshType; let refreshType = data.refreshType;
let content = data.content;
switch (refreshType){ switch (refreshType){
case 'today_safety_index': case 'today_safety_index':
console.log('今日安全指数刷新~~~~~~~~~~~~~~~~~~~~'); console.log('今日安全指数刷新~~~~~~~~~~~~~~~~~~~~');
...@@ -77,13 +55,12 @@ export default class StatisticalLeft extends Component { ...@@ -77,13 +55,12 @@ export default class StatisticalLeft extends Component {
render() { render() {
const wsURL = completeToken(SysWsURL.viewIndexws); const wsURL = completeToken(SysWsURL.viewIndexws);
const { flag } = this.state;
return ( return (
<div className="statistical-left"> <div className="statistical-left">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug />
<RiskControl ondetails={this.ondetails} /> <RiskControl />
<DangerControl ondetails={this.ondetails} /> <DangerControl />
<AlarmControl ondetails={this.ondetails} /> <AlarmControl />
</div> </div>
); );
} }
......
...@@ -10,14 +10,12 @@ import SysWsURL, { completeToken } from '../../../consts/wsUrlConsts'; ...@@ -10,14 +10,12 @@ import SysWsURL, { completeToken } from '../../../consts/wsUrlConsts';
* 全景监控统计 * 全景监控统计
*/ */
export default class StatisticalRight extends Component { export default class StatisticalRight extends Component {
handleData = (data = {}) => { handleData = (data = {}) => {
console.log('ws data:', data); console.log('ws data:', data);
data = JSON.parse(JSON.stringify(data)); data = JSON.parse(JSON.stringify(data));
console.log(data); console.log(data);
let refreshType = data.refreshType; let refreshType = data.refreshType;
let content = data.content; switch (refreshType) {
switch (refreshType){
case 'error_status': case 'error_status':
console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~'); console.log('异常区域刷新~~~~~~~~~~~~~~~~~~~~');
break; break;
...@@ -40,19 +38,18 @@ export default class StatisticalRight extends Component { ...@@ -40,19 +38,18 @@ export default class StatisticalRight extends Component {
this.FireStrength.FireStrengthData(); this.FireStrength.FireStrengthData();
break; break;
default: default:
console.log(refreshType,':类型不支持'); console.log(refreshType, ':类型不支持');
}
} }
};
render() { render() {
const wsURL = completeToken(SysWsURL.viewIndexws); const wsURL = completeToken(SysWsURL.viewIndexws);
return ( return (
<div className="statistical-right"> <div className="statistical-right">
<AmosWebSocket ref={node => this.aws = node} url={wsURL} onMessage={this.handleData} reconnect debug /> <AmosWebSocket ref={node => (this.aws = node)} url={wsURL} onMessage={this.handleData} reconnect debug />
<AllSafety ref={node => this.AllSafety = node} /> <AllSafety ref={node => (this.AllSafety = node)} />
<FireSafety ref={node => this.FireSafety = node} /> <FireSafety ref={node => (this.FireSafety = node)} />
<FireStrength ref={node => this.FireStrength = node} /> <FireStrength ref={node => (this.FireStrength = node)} />
</div> </div>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment