Commit 8914db12 authored by taabe's avatar taabe

优化关联设备指标添加编辑页面

parent e6d5414e
...@@ -148,7 +148,7 @@ export const FasSerUrl = { ...@@ -148,7 +148,7 @@ export const FasSerUrl = {
bindPointUrl: completePrefix(baseURI, 'api/risksource/bindFmea/pointInputitem'),//巡检点关联 bindPointUrl: completePrefix(baseURI, 'api/risksource/bindFmea/pointInputitem'),//巡检点关联
riskSourceRpnCountUrl: completePrefix(baseURI,'api/risksource/rpn/list'), // 查询风险点RPN统计 riskSourceRpnCountUrl: completePrefix(baseURI,'api/risksource/rpn/list'), // 查询风险点RPN统计
bindEquipListUrl: completePrefix(baseURI, 'api/risksource/fireequiment/relation/all?equimentId={equimentId}&fname={fname}&pageNumber={page}&pageSize={size}'),//配套设施查询(已绑定及未绑定) bindEquipListUrl: completePrefix(baseURI, 'api/risksource/fireequiment/relation/all?equimentId={equimentId}&fname={fname}&pageNumber={page}&pageSize={size}'),//配套设施查询(已绑定及未绑定)
getBindEquipIndexUrl: completePrefix(baseURI, 'api/risksource/listEquipmentPointById?fmeaId={fmeaId}&equimentId={equimentId}&equipmentPointName={equipmentPointName}'),//获取配套设备指标项 getBindEquipIndexUrl: completePrefix(baseURI, 'api/risksource/listEquipmentPointById?fmeaId={fmeaId}&importantEquipId={importantEquipId}&equimentId={equimentId}&equipmentPointName={equipmentPointName}'),//获取配套设备指标项
bindEquipIndexUrl: completePrefix(baseURI, 'api/risksource/bingFmea/equimentPoint'), bindEquipIndexUrl: completePrefix(baseURI, 'api/risksource/bingFmea/equimentPoint'),
deleteBindEquipUrl: completePrefix(baseURI, 'api/risksource/fireequiment/relation/{ids}'), deleteBindEquipUrl: completePrefix(baseURI, 'api/risksource/fireequiment/relation/{ids}'),
removeByRSIdAndPIdUrl: completePrefix(baseURI, 'api/risksource/removeByRSIdAndPId'),//删除绑定的设备 removeByRSIdAndPIdUrl: completePrefix(baseURI, 'api/risksource/removeByRSIdAndPId'),//删除绑定的设备
......
...@@ -111,8 +111,8 @@ export const bindEquipListAction = (riskSourceId , equimentId, page, size,fname) ...@@ -111,8 +111,8 @@ export const bindEquipListAction = (riskSourceId , equimentId, page, size,fname)
return commonGet(formatUrl(FasSerUrl.bindEquipListUrl, { riskSourceId,equimentId,fname,page,size })); return commonGet(formatUrl(FasSerUrl.bindEquipListUrl, { riskSourceId,equimentId,fname,page,size }));
}; };
export const getBindEquipIndexAction = (fmeaId, equimentId, equipmentPointName) => { export const getBindEquipIndexAction = (fmeaId, importantEquipId, equimentId, equipmentPointName) => {
let url = formatUrl(FasSerUrl.getBindEquipIndexUrl, { fmeaId, equimentId, equipmentPointName }); let url = formatUrl(FasSerUrl.getBindEquipIndexUrl, { fmeaId, importantEquipId, equimentId, equipmentPointName });
return commonGet(url); return commonGet(url);
}; };
......
...@@ -28,13 +28,13 @@ const matchEquipmentTableColumns = self => { ...@@ -28,13 +28,13 @@ const matchEquipmentTableColumns = self => {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'code',
key: 'code', key: 'code',
width: '20%' width: '15%'
}, },
{ {
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '25%' width: '22%'
}, },
{ {
title: '建/构筑物', title: '建/构筑物',
...@@ -46,7 +46,7 @@ const matchEquipmentTableColumns = self => { ...@@ -46,7 +46,7 @@ const matchEquipmentTableColumns = self => {
title: '楼层', title: '楼层',
dataIndex: 'floor3d', dataIndex: 'floor3d',
key: 'floor3d', key: 'floor3d',
width: '5%' width: '10%'
}, },
{ {
title: '房间', title: '房间',
......
...@@ -26,7 +26,7 @@ const equipmentTableColumns = self => { ...@@ -26,7 +26,7 @@ const equipmentTableColumns = self => {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'code',
key: 'code', key: 'code',
width: '15%' width: '10%'
}, },
{ {
title: '名称', title: '名称',
...@@ -44,7 +44,7 @@ const equipmentTableColumns = self => { ...@@ -44,7 +44,7 @@ const equipmentTableColumns = self => {
title: '位置', title: '位置',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: '15%' width: '23%'
}, },
{ {
title: '配套设备', title: '配套设备',
......
...@@ -32,7 +32,7 @@ const fireEquipmentTableColumns = self => { ...@@ -32,7 +32,7 @@ const fireEquipmentTableColumns = self => {
title: '装备名称', title: '装备名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '9%' width: '8%'
}, },
{ {
title: '分类', title: '分类',
...@@ -69,7 +69,7 @@ const fireEquipmentTableColumns = self => { ...@@ -69,7 +69,7 @@ const fireEquipmentTableColumns = self => {
title: '建/构筑物', title: '建/构筑物',
dataIndex: 'riskSourceName', dataIndex: 'riskSourceName',
key: 'riskSourceName', key: 'riskSourceName',
width: '6%' width: '8%'
}, },
{ {
title: '楼层', title: '楼层',
...@@ -81,7 +81,7 @@ const fireEquipmentTableColumns = self => { ...@@ -81,7 +81,7 @@ const fireEquipmentTableColumns = self => {
title: '房间', title: '房间',
dataIndex: 'room', dataIndex: 'room',
key: 'room', key: 'room',
width: '4%' width: '6%'
}, },
{ {
title: '保养周期(月)', title: '保养周期(月)',
...@@ -99,7 +99,7 @@ const fireEquipmentTableColumns = self => { ...@@ -99,7 +99,7 @@ const fireEquipmentTableColumns = self => {
title: '品牌', title: '品牌',
dataIndex: 'brand', dataIndex: 'brand',
key: 'brand', key: 'brand',
width: '5%' width: '8%'
}, },
{ {
title: '生产日期', title: '生产日期',
......
...@@ -30,31 +30,31 @@ const fireStationTableColumns = self => { ...@@ -30,31 +30,31 @@ const fireStationTableColumns = self => {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'code',
key: 'code', key: 'code',
width: '15%' width: '10%'
}, },
{ {
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
width: '20%' width: '25%'
}, },
{ {
title: '所属区域', title: '所属区域',
dataIndex: 'riskSourceName', dataIndex: 'riskSourceName',
key: 'riskSourceName', key: 'riskSourceName',
width: '20%' width: '25%'
}, },
{ {
title: '位置', title: '位置',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: '30%' width: '24%'
}, },
{ {
title: '配套设备', title: '配套设备',
dataIndex: '', dataIndex: '',
key: '', key: '',
width: '20%', width: '10%',
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<span> <span>
......
...@@ -25,7 +25,7 @@ const fireTruckTableColumns = self => { ...@@ -25,7 +25,7 @@ const fireTruckTableColumns = self => {
title: '车辆类型', title: '车辆类型',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
width: '15%' width: '10%'
}, },
{ {
title: '车辆名称', title: '车辆名称',
...@@ -43,25 +43,25 @@ const fireTruckTableColumns = self => { ...@@ -43,25 +43,25 @@ const fireTruckTableColumns = self => {
title: '发动机号', title: '发动机号',
dataIndex: 'engineNum', dataIndex: 'engineNum',
key: 'engineNum', key: 'engineNum',
width: '10%' width: '12%'
}, },
{ {
title: '厂牌型号', title: '厂牌型号',
dataIndex: 'model', dataIndex: 'model',
key: 'model', key: 'model',
width: '10%' width: '13%'
}, },
{ {
title: '国别', title: '国别',
dataIndex: 'country', dataIndex: 'country',
key: 'country', key: 'country',
width: '10%' width: '7%'
}, },
{ {
title: '所在区域', title: '所在区域',
dataIndex: 'riskSourceName', dataIndex: 'riskSourceName',
key: 'riskSourceName', key: 'riskSourceName',
width: '10%' width: '15%'
}, },
// { // {
// title: '车辆状态', // title: '车辆状态',
......
...@@ -35,7 +35,7 @@ const fireDetectorTableColumns = self => { ...@@ -35,7 +35,7 @@ const fireDetectorTableColumns = self => {
title: '重量', title: '重量',
dataIndex: 'weight', dataIndex: 'weight',
key: 'weight', key: 'weight',
width: '5%' width: '4%'
}, },
{ {
title: '设备状态', title: '设备状态',
......
...@@ -30,7 +30,7 @@ const fireFoamTableColumns = self => { ...@@ -30,7 +30,7 @@ const fireFoamTableColumns = self => {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'code',
key: 'code', key: 'code',
width: '17%' width: '10%'
}, },
{ {
title: '名称', title: '名称',
...@@ -42,19 +42,19 @@ const fireFoamTableColumns = self => { ...@@ -42,19 +42,19 @@ const fireFoamTableColumns = self => {
title: '所属区域', title: '所属区域',
dataIndex: 'riskSourceName', dataIndex: 'riskSourceName',
key: 'riskSourceName', key: 'riskSourceName',
width: '20%' width: '25%'
}, },
{ {
title: '位置', title: '位置',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: '30%' width: '24%'
}, },
{ {
title: '配套设备', title: '配套设备',
dataIndex: '', dataIndex: '',
key: '', key: '',
width: '20%', width: '10%',
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<span> <span>
......
...@@ -23,7 +23,7 @@ const fireWaterTableColumns = self => { ...@@ -23,7 +23,7 @@ const fireWaterTableColumns = self => {
title: '编号', title: '编号',
dataIndex: 'code', dataIndex: 'code',
key: 'code', key: 'code',
width: '10%' width: '11%'
}, },
{ {
title: '名称', title: '名称',
...@@ -41,7 +41,7 @@ const fireWaterTableColumns = self => { ...@@ -41,7 +41,7 @@ const fireWaterTableColumns = self => {
title: '楼层', title: '楼层',
dataIndex: 'floor3d', dataIndex: 'floor3d',
key: 'floor3d', key: 'floor3d',
width: '10%' width: '5%'
}, },
{ {
title: '房间', title: '房间',
...@@ -59,7 +59,7 @@ const fireWaterTableColumns = self => { ...@@ -59,7 +59,7 @@ const fireWaterTableColumns = self => {
title: '配套设备', title: '配套设备',
dataIndex: '', dataIndex: '',
key: '', key: '',
width: '10%', width: '8%',
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<span> <span>
......
...@@ -21,8 +21,8 @@ const getColumns = () => { ...@@ -21,8 +21,8 @@ const getColumns = () => {
}, },
{ {
title: '所属重点设备', title: '所属重点设备',
dataIndex: 'importantEquip', dataIndex: 'importantEquipName',
key: 'importantEquip', key: 'importantEquipName',
width: '25%', width: '25%',
className: 'uant-table-thead' className: 'uant-table-thead'
}, },
...@@ -31,7 +31,38 @@ const getColumns = () => { ...@@ -31,7 +31,38 @@ const getColumns = () => {
dataIndex: 'equipmentPointNames', dataIndex: 'equipmentPointNames',
key: 'equipmentPointNames', key: 'equipmentPointNames',
width: '35%', width: '35%',
className: 'uant-table-thead' className: 'uant-table-thead',
render: (text, record) => {
//根据换行符分隔
let arr = text.split('\n');
let p = document.createElement('span');
if (arr && arr != null){
arr.map( e => {
if (e.endsWith('##0')){
let grandChildItem = document.createElement('p');
let a = e.replace('##0','');
grandChildItem.innerText = a;
let font = document.createElement('font');
font.innerText = ' 正常';
font.style.color = 'green';
grandChildItem.append(font);
p.append(grandChildItem);
} else {
let grandChildItem = document.createElement('p');
let b = e.replace('##1','');
grandChildItem.innerText = b;
let font = document.createElement('font');
font.innerText = ' 报警';
font.style.color = 'red';
grandChildItem.append(font);
p.append(grandChildItem);
}
});
return <div dangerouslySetInnerHTML={{ __html: p.outerHTML }} />;
}
}
} }
]; ];
}; };
...@@ -58,17 +89,18 @@ class AssociatedEquipTable extends Component { ...@@ -58,17 +89,18 @@ class AssociatedEquipTable extends Component {
onRowClick = record => { onRowClick = record => {
let { selectedRowKeys, selectedRows } = this.state; let { selectedRowKeys, selectedRows } = this.state;
let exist = false; let exist = false;
let id = record.importantEquipId + '-' + record.equipmentId;
selectedRows.find(item => { selectedRows.find(item => {
if (item.equipmentId === record.equipmentId) { if (item.id === id) {
exist = true; exist = true;
} }
}); });
if (exist) { if (exist) {
selectedRows.splice(selectedRows.findIndex(item => item.equipmentId === record.equipmentId), 1); selectedRows.splice(selectedRows.findIndex(item => item.id === id), 1);
selectedRowKeys.splice(selectedRowKeys.findIndex(item => item === record.equipmentId), 1); selectedRowKeys.splice(selectedRowKeys.findIndex(item => item === id), 1);
} else { } else {
selectedRows.push(record); selectedRows.push(record);
selectedRowKeys.push(record.equipmentId); selectedRowKeys.push(id);
} }
this.setState({ this.setState({
selectedRows, selectedRows,
...@@ -97,7 +129,8 @@ class AssociatedEquipTable extends Component { ...@@ -97,7 +129,8 @@ class AssociatedEquipTable extends Component {
getRowClassName = (record, index) => { getRowClassName = (record, index) => {
let { selectedRowKeys } = this.state; let { selectedRowKeys } = this.state;
if (selectedRowKeys.findIndex(item => item === record.equipmentId) >= 0) { let id = record.importantEquipId + '-' + record.equipmentId;
if (selectedRowKeys.findIndex(item => item === id) >= 0) {
return 'highlight-row'; return 'highlight-row';
} else { } else {
return 'normal-row'; return 'normal-row';
...@@ -132,7 +165,7 @@ class AssociatedEquipTable extends Component { ...@@ -132,7 +165,7 @@ class AssociatedEquipTable extends Component {
render() { render() {
let { pagination, isChecked, selectedRowKeys } = this.state; let { pagination, isChecked, selectedRowKeys } = this.state;
let { dataList, fetchData, totalCount } = this.props; let { dataList, fetchData, totalCount } = this.props;
dataList.map(data => data.id = data.equipmentId); dataList.map(data => data.id = data.importantEquipId + '-' + data.equipmentId );
let defaultPageConfig = this.pageConfig; let defaultPageConfig = this.pageConfig;
return ( return (
<div className="risk-model-table"> <div className="risk-model-table">
......
...@@ -46,37 +46,34 @@ const getColumns = () => { ...@@ -46,37 +46,34 @@ const getColumns = () => {
width: '40%', width: '40%',
className: 'uant-table-thead', className: 'uant-table-thead',
render: (text, record) => { render: (text, record) => {
//根据换行符分隔 //根据换行符分隔
let arr = text.split("\n"); let arr = text.split('\n');
let p = document.createElement('span') let p = document.createElement('span');
if(arr && arr!= null){ if (arr && arr != null){
arr.map( e =>{ arr.map( e =>{
if(e.endsWith("##0")){ if (e.endsWith('##0')){
let grandChildItem = document.createElement('p'); let grandChildItem = document.createElement('p');
let a = e.replace("##0",""); let a = e.replace('##0','');
grandChildItem.innerText=a; grandChildItem.innerText = a;
let font = document.createElement('font'); let font = document.createElement('font');
font.innerText=" 合格"; font.innerText = ' 合格';
font.style.color="green"; font.style.color = 'green';
grandChildItem.append(font); grandChildItem.append(font);
p.append(grandChildItem) p.append(grandChildItem);
} else {
}else{
let grandChildItem = document.createElement('p'); let grandChildItem = document.createElement('p');
let b = e.replace("##1",""); let b = e.replace('##1','');
grandChildItem.innerText=b; grandChildItem.innerText = b;
let font = document.createElement('font'); let font = document.createElement('font');
font.innerText=" 不合格"; font.innerText = ' 不合格';
font.style.color="red"; font.style.color = 'red';
grandChildItem.append(font); grandChildItem.append(font);
p.append(grandChildItem) p.append(grandChildItem);
} }
}) });
return <div dangerouslySetInnerHTML = {{__html:p.outerHTML}} ></div> return <div dangerouslySetInnerHTML={{ __html: p.outerHTML }} />;
} }
} }
} }
......
...@@ -400,11 +400,11 @@ class RiskModel extends Component { ...@@ -400,11 +400,11 @@ class RiskModel extends Component {
fmeaId && this.bindPoints(fmeaId, pointId, selectData); fmeaId && this.bindPoints(fmeaId, pointId, selectData);
} }
bindEquipIndexCallback = (equipmentId) => { bindEquipIndexCallback = (importantEquipId, equipmentId) => {
const { fmeaId } = this.state; const { fmeaId } = this.state;
let { selectData } = this.model.state; let { selectData } = this.model.state;
selectData = selectData.filter(data => data.equipmentId === equipmentId); selectData = selectData.filter(data => data.equipmentId === equipmentId);
fmeaId && this.bindEquipIndexs(fmeaId , equipmentId, selectData); fmeaId && this.bindEquipIndexs(fmeaId, importantEquipId, equipmentId, selectData);
} }
riskSourceEdit = (body) =>{ riskSourceEdit = (body) =>{
...@@ -440,14 +440,15 @@ class RiskModel extends Component { ...@@ -440,14 +440,15 @@ class RiskModel extends Component {
); );
}; };
bindEquipIndexs = (fmeaId, equipmentId, equipIndexs) => { bindEquipIndexs = (fmeaId, importEquipId, equipmentId, equipIndexs) => {
let equipmentPointIds = []; let equipmentPointIds = [];
let param = {}; let param = {};
equipIndexs.map(item => { equipIndexs.map(item => {
equipmentPointIds.push(item.equipIndexId); equipmentPointIds.push(item.equipIndexId);
}); });
param.equipmentId = equipmentId;
param.fmeaId = fmeaId; param.fmeaId = fmeaId;
param.importantEquipmentId = importEquipId;
param.equipmentId = equipmentId;
param.equipmentPointIds = equipmentPointIds; param.equipmentPointIds = equipmentPointIds;
bindEquipIndexAction(param).then( bindEquipIndexAction(param).then(
data => { data => {
...@@ -618,11 +619,12 @@ class RiskModel extends Component { ...@@ -618,11 +619,12 @@ class RiskModel extends Component {
} }
} else if (modelFlag === 'equip'){ } else if (modelFlag === 'equip'){
if (toolBarFlag){ if (toolBarFlag){
let { equipData } = this.state;
if (toolBarFlag === '1'){//新增 if (toolBarFlag === '1'){//新增
return <EquipModel bindEquipIndexCallback={this.bindEquipIndexCallback} fmeaId={fmeaId} riskSourceId={riskSourceId} ref={component => this.model = component} /> ; return <EquipModel bindingEquips={equipData} bindEquipIndexCallback={this.bindEquipIndexCallback} fmeaId={fmeaId} riskSourceId={riskSourceId} ref={component => this.model = component} /> ;
} else if (this.equipRef) { } else if (this.equipRef) {
const { selectedRows } = this.equipRef.state; const { selectedRows } = this.equipRef.state;
return <EquipModel {...selectedRows[0]} bindEquipIndexCallback={this.bindEquipIndexCallback} fmeaId={fmeaId} riskSourceId={riskSourceId} ref={component =>this.model = component} /> ; return <EquipModel bindingEquips={equipData} {...selectedRows[0]} bindEquipIndexCallback={this.bindEquipIndexCallback} fmeaId={fmeaId} riskSourceId={riskSourceId} ref={component =>this.model = component} /> ;
} }
} }
} }
......
...@@ -28,8 +28,8 @@ class EquipModel extends Component { ...@@ -28,8 +28,8 @@ class EquipModel extends Component {
} }
componentWillMount = () => { componentWillMount = () => {
let { eId } = { ...this.props }; let { importantEquipId } = { ...this.props };
eId && this.setState({ eId }); importantEquipId && this.setState({ importantEquipId });
}; };
setParamAndSearch =(param)=>{ setParamAndSearch =(param)=>{
...@@ -60,10 +60,30 @@ class EquipModel extends Component { ...@@ -60,10 +60,30 @@ class EquipModel extends Component {
} }
queryBindEquip = (riskSourceId, equipmentId, fname) => { queryBindEquip = (riskSourceId, equipmentId, fname) => {
let { bindingEquips, importantEquipId } = this.props;
let bindingEquipIds = [];
bindingEquips.map(b => {
if (b.importantEquipId === equipmentId) {
bindingEquipIds.push(b.equipmentId);
}
});
this.setState({ importEquipId: equipmentId }); this.setState({ importEquipId: equipmentId });
equipmentId && bindEquipListAction(riskSourceId, equipmentId,0,-1,fname).then(data=>{//查询巡检点项 equipmentId && bindEquipListAction(riskSourceId, equipmentId,0,-1,fname).then(data=>{//查询巡检点项
let { selectData } = this.state; let { selectData } = this.state;
let content = data.content;//内容 let content = data.content;//内容
//过滤已经添加的配套设备
content = content.filter(equip => {
console.log(equip);
if (importantEquipId) {
if (bindingEquipIds.includes(equip.id)) {
return true;
}
} else {
if (!bindingEquipIds.includes(equip.id)) {
return true;
}
}
});
if (!fname){ if (!fname){
let fireEquip = content.filter(item => item.isBound === 'bound');//已经选择的行数据 let fireEquip = content.filter(item => item.isBound === 'bound');//已经选择的行数据
let selects = fireEquip.map(e=>{//已经选择的id集合 let selects = fireEquip.map(e=>{//已经选择的id集合
...@@ -86,7 +106,8 @@ class EquipModel extends Component { ...@@ -86,7 +106,8 @@ class EquipModel extends Component {
} }
queryBindEquipIndex = (fmeaId, equipmentId, equipmentPointName) => { queryBindEquipIndex = (fmeaId, equipmentId, equipmentPointName) => {
fmeaId && equipmentId && getBindEquipIndexAction(fmeaId, equipmentId, equipmentPointName).then(data => { let { importEquipId } = this.state;
fmeaId && equipmentId && getBindEquipIndexAction(fmeaId, importEquipId, equipmentId, equipmentPointName).then(data => {
console.log(data); console.log(data);
let { selectData } = this.state; let { selectData } = this.state;
if (!equipmentPointName){ if (!equipmentPointName){
...@@ -120,12 +141,12 @@ class EquipModel extends Component { ...@@ -120,12 +141,12 @@ class EquipModel extends Component {
render() { render() {
let { riskSourceId, bindEquipIndexCallback, fmeaId } = this.props; let { riskSourceId, bindEquipIndexCallback, fmeaId } = this.props;
let { dataList, importEquipId, equipmentId, selects, eId, indexDataList } = this.state; let { dataList, importEquipId, equipmentId, selects, importantEquipId, indexDataList } = this.state;
return ( return (
<div className="equip-model"> <div className="equip-model">
<EquipTable riskSourceId={riskSourceId} importEquipId={eId} fetchData={this.queryBindEquip} clearCallback={this.clearCallback} /> <EquipTable riskSourceId={riskSourceId} importEquipId={importantEquipId} fetchData={this.queryBindEquip} clearCallback={this.clearCallback} />
<FireEquipTable fmeaId={fmeaId} importEquipId={importEquipId} selects={selects} dataList={dataList} setParamAndSearch={this.setParamAndSearch} fetchData={this.queryBindEquipIndex} clearCallback={this.clearCallback} /> <FireEquipTable fmeaId={fmeaId} importEquipId={importEquipId} selects={selects} dataList={dataList} setParamAndSearch={this.setParamAndSearch} fetchData={this.queryBindEquipIndex} clearCallback={this.clearCallback} />
<FireEquipIndexTable bindEquipIndexCallback={bindEquipIndexCallback} fmeaId={fmeaId} equipmentId={equipmentId} selects={selects} dataList={indexDataList} callBack={this.setSelectData} setParamAndSearch={this.setParamAndSearch} /> <FireEquipIndexTable bindEquipIndexCallback={bindEquipIndexCallback} fmeaId={fmeaId} importantEquipId={importEquipId} equipmentId={equipmentId} selects={selects} dataList={indexDataList} callBack={this.setSelectData} setParamAndSearch={this.setParamAndSearch} />
</div> </div>
); );
} }
...@@ -134,6 +155,8 @@ class EquipModel extends Component { ...@@ -134,6 +155,8 @@ class EquipModel extends Component {
EquipModel.propTypes = { EquipModel.propTypes = {
bindEquipIndexCallback: PropTypes.func, bindEquipIndexCallback: PropTypes.func,
riskSourceId: PropTypes.any, riskSourceId: PropTypes.any,
fmeaId: PropTypes.number fmeaId: PropTypes.number,
bindingEquips: PropTypes.array,
importantEquipId: PropTypes.number
}; };
export default EquipModel; export default EquipModel;
...@@ -124,8 +124,8 @@ class FireEquipIndexTable extends Component { ...@@ -124,8 +124,8 @@ class FireEquipIndexTable extends Component {
} }
save = () => { save = () => {
const { equipmentId } = this.props; const { importantEquipId, equipmentId } = this.props;
this.props.bindEquipIndexCallback(equipmentId); this.props.bindEquipIndexCallback(importantEquipId, equipmentId);
} }
render() { render() {
...@@ -165,6 +165,7 @@ FireEquipIndexTable.propTypes = { ...@@ -165,6 +165,7 @@ FireEquipIndexTable.propTypes = {
setParamAndSearch: PropTypes.func, setParamAndSearch: PropTypes.func,
callBack: PropTypes.func, callBack: PropTypes.func,
dataList: PropTypes.array, dataList: PropTypes.array,
selects: PropTypes.array selects: PropTypes.array,
importantEquipId: PropTypes.number
}; };
export default FireEquipIndexTable; export default FireEquipIndexTable;
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