Commit 93cb8cff authored by 李成龙's avatar 李成龙

优化代码

parents 7075e406 b78c730e
......@@ -14,6 +14,11 @@ const AsyncSafetyTraining = props => <AsyncLoader load={import('../view/monitor/
const AsyncDaliyTraining = props => <AsyncLoader load={import('../view/monitor/dailyTrain/index')} componentProps={props} />;
const AsyncEquipmentMaintain = props => <AsyncLoader load={import('../view/monitor/equipmentMaintain/index')} componentProps={props} />;
const AsyncSafetyInspection = props => <AsyncLoader load={import('../view/monitor/safetyInspection/index')} componentProps={props} />;
const AsyncFireMaterial = props => <AsyncLoader load={import('../view/strength/fireMaterial/index')} componentProps={props} />;
const AsyncFireVehicle = props => <AsyncLoader load={import('../view/strength/fireVehicle/index')} componentProps={props} />;
const AsyncStationFireMan = props => <AsyncLoader load={import('../view/strength/stationFireMan/index')} componentProps={props} />;
const AsyncStationFireTeam = props => <AsyncLoader load={import('../view/strength/stationFireTeam/index')} componentProps={props} />;
const AsyncStationDuty = props => <AsyncLoader load={import('../view/strength/stationDuty/index')} componentProps={props} />;
// const AsyncRegionList = props => <AsyncLoader load={import('./../view/common/region/index')} componentProps={props} />;
......@@ -27,7 +32,12 @@ const Routes = {
safetyTraining: AsyncSafetyTraining,
dailyTrain:AsyncDaliyTraining,
equipmentMaintain:AsyncEquipmentMaintain,
safetyInspection:AsyncSafetyInspection
safetyInspection:AsyncSafetyInspection,
fireMaterial:AsyncFireMaterial,
fireVehicle:AsyncFireVehicle,
stationFireMan:AsyncStationFireMan,
stationFireTeam:AsyncStationFireTeam,
stationDuty:AsyncStationDuty,
};
export const businessRouts = [
{ path: 'situation',group: 'biz',component: AsyncSituation, childRoutes: [] },
......@@ -36,7 +46,12 @@ export const businessRouts = [
{ path: 'bills',group: 'biz',component: AsyncBills, childRoutes: [] },
{ path: 'dailyTrain',group: 'biz',component: AsyncDaliyTraining, childRoutes: [] },
{ path: 'equipmentMaintain',group: 'biz',component: AsyncEquipmentMaintain, childRoutes: [] },
{ path: 'safetyInspection',group: 'biz',component: AsyncSafetyInspection, childRoutes: [] }
{ path: 'safetyInspection',group: 'biz',component: AsyncSafetyInspection, childRoutes: [] },
{ path: 'fireMaterial',group: 'biz',component: AsyncFireMaterial, childRoutes: [] },
{ path: 'fireVehicle',group: 'biz',component: AsyncFireVehicle, childRoutes: [] },
{ path: 'stationFireMan',group: 'biz',component: AsyncStationFireMan, childRoutes: [] },
{ path: 'stationFireTeam',group: 'biz',component: AsyncStationFireTeam, childRoutes: [] },
{ path: 'stationDuty',group: 'biz',component: AsyncStationDuty, childRoutes: [] },
];
const pageCompontent = key => {
return Routes[key] || AsyncEmptyPage;
......
......@@ -11,6 +11,11 @@ import SafetyTraining from './../view/monitor/safetyManage/index';
import DaliyTraining from './../view/monitor/dailyTrain/index';
import EquipmentMaintain from './../view/monitor/equipmentMaintain/index';
import SafetyInspection from './../view/monitor/safetyInspection/index';
import FireMaterial from './../view/strength/fireMaterial/index';
import FireVehicle from './../view/strength/fireVehicle/index';
import StationFireMan from './../view/strength/stationFireMan/index';
import StationFireTeam from './../view/strength/stationFireTeam/index';
import StationDuty from './../view/strength/stationDuty/index';
const Routes = {
main: RootView,
......@@ -19,10 +24,17 @@ const Routes = {
situationDetail: SituationDetail,
regulate: Regulate,
bills: Bills,
safetyTraining: SafetyTraining,
dailyTrain: DaliyTraining,
equipmentMaintain: EquipmentMaintain,
safetyInspection: SafetyInspection
fireMaterial: FireMaterial,
fireVehicle: FireVehicle,
stationFireMan: StationFireMan,
stationFireTeam: StationFireTeam,
stationDuty: StationDuty,
};
export const businessRouts = [
{ path: 'situation',group: 'biz',component: Situation, childRoutes: [] },
......@@ -31,7 +43,12 @@ export const businessRouts = [
{ path: 'safetyTraining',group: 'biz',component: SafetyTraining, childRoutes: [] },
{ path: 'dailyTrain',group: 'biz',component: DaliyTraining, childRoutes: [] },
{ path: 'equipmentMaintain',group: 'biz',component: EquipmentMaintain, childRoutes: [] },
{ path: 'safetyInspection',group: 'biz',component: SafetyInspection, childRoutes: [] }
{ path: 'safetyInspection',group: 'biz',component: SafetyInspection, childRoutes: [] },
{ path: 'fireMaterial',group: 'biz',component: FireMaterial, childRoutes: [] },
{ path: 'fireVehicle',group: 'biz',component: FireVehicle, childRoutes: [] },
{ path: 'stationFireMan',group: 'biz',component: StationFireMan, childRoutes: [] },
{ path: 'stationFireTeam',group: 'biz',component: StationFireTeam, childRoutes: [] },
{ path: 'stationDuty',group: 'biz',component: StationDuty, childRoutes: [] },
];
const pageCompontent = key => {
return Routes[key] || EmptyPage;
......
......@@ -107,17 +107,6 @@
}
}
.time {
position: relative;
width: 350px;
display: inline-block;
color: aqua;
top: -35px;
left: 80%;
font-size: 20px;
font-weight: bold;
}
.dangerClass{
margin-left:240;
margin-top:10;
......
......@@ -21,3 +21,7 @@
@import './monitor/safetyInspection.scss';
//驻站消防员
@import './strength/stationFireMan.scss';
//站内值守人员
@import './strength/stationDuty.scss';
......@@ -89,7 +89,8 @@
border-color: transparent !important;
}
}
}
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,10 +19,8 @@ class SituationDetail extends Component {
situationData: situationDetailData
};
}
c
/**
/**
* 设定间隔行样式
*/
rowClassChange = (record, index) => {
......@@ -199,7 +197,6 @@ class SituationDetail extends Component {
const _pageNation = { pageSize: pageSize, size: 'small', showTotal: this.showTotalPage};
return (
<div className="class-situation-detail">
<div class="time"> 2018-06-03 09:16:18 星期五 [合肥]</div>
<Layout>
<Header style={{display:'flex'}}>
......
......@@ -41,7 +41,7 @@ class RootView extends Component {
let systemMenu = [];
let systemMenus = JSON.parse(lsTool.read(sessionConsts.systemMenu));
systemMenus.map(e =>{
if(e.permissionName && e.permissionName !=="消防安全管理" ){
if(e.permissionName && e.permissionName !=="消防安全管理" && e.permissionName !=="消防实力情况" ){
systemMenu.push(e)
}
})
......
import React, { Component } from 'react';
import { Modal } from 'amos-framework';
import FireStrengthDetail from'./../firestrength/FireStrengthDetail';
import { sessionConsts } from './../../../consts/storageConsts';
import {Store, } from 'amos-tool';
const lsTool = Store.lsTool;
/**
* 消防实力统计
*/
......@@ -20,10 +22,18 @@ class FireStrength extends Component {
}
onClick=()=>
{
alert(123);
}
onClick = () =>{
let sbm = null
let systemMenu = JSON.parse(lsTool.read(sessionConsts.systemMenu)) || [];
systemMenu.map(e =>{
if(e.permissionName && e.permissionName==="消防实力情况" ){
sbm = e;
}
})
if(sbm!==null){
window.localStorage.setItem('submenu',JSON.stringify(sbm.children));
}
}
render() {
......
export const stationList = [
{
id: 1, name: '复龙换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 2, name: '奉贤换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 3, name: '锦屏换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 4, name: '苏州换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 5, name: '天山换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 6, name: '中州换流站', fireManCounts: '10', dutyCounts: '10', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 7, name: '宜宾换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 8, name: '金华换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 9, name: '龙泉换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 10, name: '政平换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 11, name: '伊克昭换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 12, name: '沂南换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 13, name: '陕北换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 14, name: '武汉换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 15, name: '洛阳换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 16, name: '贵州换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
{
id: 17, name: '驻马店换流站', fireManCounts: '30', dutyCounts: '30', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9'
},
]
export const stationDutyList = [
{
id: 1, name: '峰峰', position: '消防队长', phone: '13598745589', trainCounts: '5', trainRate: '0.93', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 2, name: '洪峰', position: '消防副队', phone: '13598745589', trainCounts: '5', trainRate: '0.94', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 3, name: '洪宏', position: '消防员', phone: '13598745589', trainCounts: '6', trainRate: '0.97', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 4, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '6', trainRate: '0.92', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 5, name: '冯峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.94', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 6, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.91', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 7, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.95', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 8, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.96', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 9, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.91', stationId:1,
},
{
id: 10, name: '洪风', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.92', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 11, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
{
id: 12, name: '洪峰', position: '消防员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.9', stationId:1,
},
]
export const stationFireManList = [
{
id: 1, name: '峰峰', position: '值班长', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.95', stationId:1,
},
{
id: 2, name: '洪峰', position: '副班长', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
{
id: 3, name: '洪宏', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.98', stationId:1,
},
{
id: 4, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.98', stationId:1,
},
{
id: 5, name: '冯峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '0.9', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
{
id: 6, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
{
id: 7, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
{
id: 8, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.97', stationId:1,
},
{
id: 9, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
{
id: 10, name: '洪风', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.97', stationId:1,
},
{
id: 11, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.97', stationId:1,
},
{
id: 12, name: '洪峰', position: '值班员', phone: '13598745589', trainCounts: '5', trainRate: '1', practiceCounts: '5', practiceRate: '0.96', stationId:1,
},
]
\ No newline at end of file
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/**
* FireMaterial
* 消防器材
* @class FireMaterial
* @extends {Component}
*/
class FireMaterial extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillMount() {
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<div className="class-fire-material">
消防器材
</div>
);
}
}
FireMaterial.propTypes = {
};
export default FireMaterial;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/**
* FireVehicle
* 消防车辆
* @class FireVehicle
* @extends {Component}
*/
class FireVehicle extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillMount() {
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<div className="class-fire-vehicle">
消防车辆
</div>
);
}
}
FireVehicle.propTypes = {
};
export default FireVehicle;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Table ,Input} from 'amos-antd';
import {stationList} from "./../data/data"
const Search = Input.Search;
const pageSize = 15;
/**
* StationDutyLeft
* 站内值守左表
* @class StationDutyLeft
* @extends {Component}
*/
class StationDutyLeft extends Component {
constructor(props) {
super(props);
this.state = {
stationDutyList:stationList,
};
}
componentDidMount() {
}
onRequestTable = (callback) => {
}
/*
* 模糊搜索
*/
onDutySearch=(value)=>{
if(value!==null&&value.trim()!==''){
let {stationDutyList}=this.state;
stationDutyList = stationDutyList.filter(item => (item.name).indexOf(value) > -1);
this.setState({
stationDutyList:stationDutyList
})
} else{
this.setState({
stationDutyList:stationList
})
}
}
columns = () => {
return(
[
{
title: '序号',
dataIndex: 'id',
width: 80,
},
{
title: '换流站名称',
dataIndex: 'name',
width: 140,
render: (text, record) => {
return (<div style={{ color: 'yellow', fontWeight: 'normal' }}>{text}</div>)
}
},
{
title: '站内值守人员',
dataIndex: 'dutyCounts',
width: 140,
},
{
title: '培训次数',
dataIndex: 'trainCounts',
width: 120,
},
{
title: '达标率',
dataIndex: 'trainRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
{
title: '训练次数',
dataIndex: 'practiceCounts',
width: 120,
},
{
title: '达标率',
dataIndex: 'practiceRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
]
)
}
/**
* 设定间隔行样式
*/
rowClassChange = (record, index) => {
let className = 'light-row';
if (index % 2 === 0) className = 'dark-row';
return className;
}
/**
* 自定义总页数
*/
showTotalPage = (total) => {
let pages = Math.ceil(total / pageSize);
return `共 ${pages} 页`;
}
render() {
const {stationDutyList} =this.state;
const _pageNation = { pageSize: pageSize, size: 'small', showTotal: this.showTotalPage};
return (
<div className="stationDuty-bottom-left" id="stationDuty-bottom-left">
<div className="stationDuty-bottom-left-content">
<div className="one-div" id="one-div">
<div className="search-one">
<div className="search-one-input">
<Search placeholder="搜索" onSearch={this.onDutySearch} />
</div>
</div>
</div>
<div className="two-div">
<Table className="tableDetail"
rowKey={record => record.id}
dataSource={stationDutyList}
style={{ background: 'linear-gradient(180deg,rgba(0,0,0,0.57) 0%,rgba(12,181,213,0.1) 100%)' }}
columns={this.columns()}
rowClassName={this.rowClassChange}
pagination={_pageNation}/>
</div>
</div>
</div>
);
}
}
StationDutyLeft.propTypes = {
};
export default StationDutyLeft;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {Table} from 'amos-antd';
import {stationDutyList} from "./../data/data"
const pageSize = 10;
/**
* StationDutyRight
* 站内值守右表
* @class StationDutyRight
* @extends {Component}
*/
class StationDutyRight extends Component {
constructor(props) {
super(props);
this.state = {
dutyManList:stationDutyList
};
}
componentDidMount() {
}
onRequestTable = (callback) => {
}
columns = () => {
return(
[
{
title: '序号',
dataIndex: 'id',
width: 80,
},
{
title: '姓名',
dataIndex: 'name',
width: 100,
},
{
title: '职务',
dataIndex: 'position',
width: 100,
},
{
title: '电话',
dataIndex: 'phone',
width: 140,
},
{
title: '培训次数',
dataIndex: 'trainCounts',
width: 100,
},
{
title: '达标率',
dataIndex: 'trainRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
{
title: '训练次数',
dataIndex: 'practiceCounts',
width: 100,
},
{
title: '达标率',
dataIndex: 'practiceRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
]
)
}
/**
* 设定间隔行样式
*/
rowClassChange = (record, index) => {
let className = 'light-row';
if (index % 2 === 0) className = 'dark-row';
return className;
}
/**
* 自定义总页数
*/
showTotalPage = (total) => {
let pages = Math.ceil(total / pageSize);
return `共 ${pages} 页`;
}
render() {
const {dutyManList} =this.state;
const _pageNation = { pageSize: pageSize, size: 'small', showTotal: this.showTotalPage};
return (
<div className="stationDuty-bottom-right" id="stationDuty-bottom-right">
<div className="stationDuty-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<Table className="tableDetail"
rowKey={record => record.id}
dataSource={dutyManList}
style={{ background: 'linear-gradient(180deg,rgba(0,0,0,0.57) 0%,rgba(12,181,213,0.1) 100%)' }}
columns={this.columns()}
rowClassName={this.rowClassChange}
pagination={_pageNation}/>
</div>
</div>
</div>
);
}
}
StationDutyRight.propTypes = {
};
export default StationDutyRight;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import StationDutyLeft from './StationDutyLeft';
import StationDutyRight from './StationDutyRight';
/**
* StationDuty
* 站内值守
* @class StationDuty
* @extends {Component}
*/
class StationDuty extends Component {
constructor(props) {
super(props);
this.state = {
activeKey: ''
};
}
componentDidMount(){
//右侧窗口默认显示第一个数据查询的列表
this.list && this.list.onRequestTable((list) => this.onEditClick(list[0]))
}
onEditClick = (record) => {
this.listTwo.onEdit(record.key)
}
render() {
return (
<div className="stationDuty-safety">
<div className="stationDuty-content">
<div className="stationDuty-top"></div>
<div className="stationDuty-bottom">
<StationDutyLeft ref={node => this.list = node} onEditClick={this.onEditClick}/>
<StationDutyRight ref={node => this.listTwo = node}/>
</div>
</div>
</div>
);
}
}
StationDuty.propTypes = {
};
export default StationDuty;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Table ,Input} from 'amos-antd';
import {stationList} from "./../data/data"
const Search = Input.Search;
const pageSize = 15;
/**
* StationFireManLeft
* 驻站消防员左表
* @class StationFireManLeft
* @extends {Component}
*/
class StationFireManLeft extends Component {
constructor(props) {
super(props);
this.state = {
stationDutyList:stationList,
};
}
componentDidMount() {
}
onRequestTable = (callback) => {
}
SearchChange = () => {
}
columns = () => {
return(
[
{
title: '序号',
dataIndex: 'id',
width: 80,
},
{
title: '换流站名称',
dataIndex: 'name',
width: 140,
render: (text, record) => {
return (<div style={{ color: 'yellow', fontWeight: 'normal' }}>{text}</div>)
}
},
{
title: '驻站消防员',
dataIndex: 'fireManCounts',
width: 140,
},
{
title: '培训次数',
dataIndex: 'trainCounts',
width: 120,
},
{
title: '达标率',
dataIndex: 'trainRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
{
title: '训练次数',
dataIndex: 'practiceCounts',
width: 120,
},
{
title: '达标率',
dataIndex: 'practiceRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
]
)
}
/**
* 设定间隔行样式
*/
rowClassChange = (record, index) => {
let className = 'light-row';
if (index % 2 === 0) className = 'dark-row';
return className;
}
/**
* 自定义总页数
*/
showTotalPage = (total) => {
let pages = Math.ceil(total / pageSize);
return `共 ${pages} 页`;
}
/*
* 模糊搜索
*/
onDutySearch=(value)=>{
if(value!==null&&value.trim()!==''){
let {stationDutyList}=this.state;
stationDutyList = stationDutyList.filter(item => (item.name).indexOf(value) > -1);
this.setState({
stationDutyList:stationDutyList
})
} else{
this.setState({
stationDutyList:stationList
})
}
}
render() {
const {stationDutyList} =this.state;
const _pageNation = { pageSize: pageSize, size: 'small', showTotal: this.showTotalPage};
return (
<div className="stationFireMan-bottom-left" id="stationFireMan-bottom-left">
<div className="stationFireMan-bottom-left-content">
<div className="one-div" id="one-div">
<div className="search-one">
<div className="search-one-input">
<Search placeholder="搜索" onSearch={this.onDutySearch} />
</div>
</div>
</div>
<div className="two-div">
<Table className="tableDetail"
rowKey={record => record.id}
dataSource={stationDutyList}
style={{ background: 'linear-gradient(180deg,rgba(0,0,0,0.57) 0%,rgba(12,181,213,0.1) 100%)' }}
columns={this.columns()}
rowClassName={this.rowClassChange}
pagination={_pageNation}/>
</div>
</div>
</div>
);
}
}
StationFireManLeft.propTypes = {
};
export default StationFireManLeft;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Table } from 'amos-antd';
import {stationFireManList} from "./../data/data"
const pageSize = 10;
/**
* StationFireManRight
* 驻站消防员右表
* @class StationFireManRight
* @extends {Component}
*/
class StationFireManRight extends Component {
constructor(props) {
super(props);
this.state = {
fireManList: stationFireManList
};
}
componentDidMount() {
}
onRequestTable = (callback) => {
}
columns = () => {
return(
[
{
title: '序号',
dataIndex: 'id',
width: 80,
},
{
title: '姓名',
dataIndex: 'name',
width: 100,
},
{
title: '职务',
dataIndex: 'position',
width: 100,
},
{
title: '电话',
dataIndex: 'phone',
width: 140,
},
{
title: '培训次数',
dataIndex: 'trainCounts',
width: 100,
},
{
title: '达标率',
dataIndex: 'trainRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
{
title: '训练次数',
dataIndex: 'practiceCounts',
width: 100,
},
{
title: '达标率',
dataIndex: 'practiceRate',
width: 100,
render: (text, record) => {
return <div>{text*100}%</div>
}
},
]
)
}
/**
* 设定间隔行样式
*/
rowClassChange = (record, index) => {
let className = 'light-row';
if (index % 2 === 0) className = 'dark-row';
return className;
}
/**
* 自定义总页数
*/
showTotalPage = (total) => {
let pages = Math.ceil(total / pageSize);
return `共 ${pages} 页`;
}
render() {
const {fireManList} =this.state;
const _pageNation = { pageSize: pageSize, size: 'small', showTotal: this.showTotalPage};
return (
<div className="stationFireMan-bottom-right" id="stationFireMan-bottom-right">
<div className="stationFireMan-bottom-right-content">
<div className="one-div">
<div className=" content-font-wenzi"> 中州换流站</div>
</div>
<div className="two-div">
<Table className="tableDetail"
rowKey={record => record.id}
dataSource={fireManList}
style={{ background: 'linear-gradient(180deg,rgba(0,0,0,0.57) 0%,rgba(12,181,213,0.1) 100%)' }}
columns={this.columns()}
rowClassName={this.rowClassChange}
pagination={_pageNation}/>
</div>
</div>
</div>
);
}
}
StationFireManRight.propTypes = {
};
export default StationFireManRight;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import StationFireManLeft from './StationFireManLeft';
import StationFireManRight from './StationFireManRight';
/**
* StationFireMan
* 驻站消防员
* @class StationFireMan
* @extends {Component}
*/
class StationFireMan extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentDidMount(){
//右侧窗口默认显示第一个数据查询的列表
this.list && this.list.onRequestTable((list) => this.onEditClick(list[0]));
}
onEditClick = (record) => {
this.listTwo.onEdit(record.key);
}
render() {
return (
<div className="stationFireMan-safety">
<div className="stationFireMan-content">
<div className="stationFireMan-top"></div>
<div className="stationFireMan-bottom">
<StationFireManLeft ref={node => this.list = node} onEditClick={this.onEditClick}/>
<StationFireManRight ref={node => this.listTwo = node}/>
</div>
</div>
</div>
);
}
}
StationFireMan.propTypes = {
};
export default StationFireMan;
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/**
* StationFireTeam
* 驻站消防队
* @class StationFireTeam
* @extends {Component}
*/
class StationFireTeam extends Component {
constructor(props) {
super(props);
this.state = {
};
}
componentWillMount() {
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<div className="class-station-fireteam">
驻站消防队
</div>
);
}
}
StationFireTeam.propTypes = {
};
export default StationFireTeam;
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