Commit 2b69086e authored by suhuiguang's avatar suhuiguang

Merge branch 'dev_upgrade' of http://172.16.10.76/station/amos-convertor-view into dev_upgrade

parents b7dc3329 1db97b33
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,7 +7,7 @@ const AmosConfig = endConf.AmosConfig;
const securityBaseWsURI = AmosConfig.wsURI.securityBaseURI;
// 三维视图
//const view3dURI = AmosConfig.httpURI.view3dURI;
const view3dURI = AmosConfig.httpURI.baseURI;
const view3dURI = AmosConfig.httpURI.view3dURI;
export const baseURI = AmosConfig.httpURI.baseURI;
//const patrolURI = AmosConfig.httpURI.patrolURI;
const patrolURI = AmosConfig.httpURI.baseURI;
......@@ -87,6 +87,7 @@ export const FscSerUrl = {
statisticsCheckUrl: completePrefix(patrolURI, 'api/view3d/statistics/check'),//今日巡检统计接口
statisticsDutyUrl: completePrefix(patrolURI, 'api/view3d/statistics/duty'), //今日值班统计
onlineDayUrl: completePrefix(patrolURI, 'api/view3d/online/date'), //消防安全执行天数
cityWeatherUrl: completePrefix(patrolURI, '/api/weather/{cityCode}'), //天气查询
//*******************************************************************************
......
import { singleFetch } from './../utils/request';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { singleFetch, commonGet } from './../utils/request';
import { FscSerUrl } from './../consts/urlConsts';
/**
* 获取在线天气
* @param {string} cityKey
*/
export const getOnlineWeather = (cityKey) => {
const url = `http://wthrcdn.etouch.cn/weather_mini?city=${cityKey}`;
return singleFetch(url);
export const getOnlineWeather = (cityCode) => {
// const url = `http://wthrcdn.etouch.cn/weather_mini?city=${cityKey}`;
return commonGet(formatUrl(FscSerUrl.cityWeatherUrl, { cityCode }));
};
export const getWeatherCityCode = () => {
return singleFetch('/src/_mock/weatherCity.json');
};
export const conmmonGetService =(url) =>{
export const conmmonGetService = (url) =>{
return singleFetch(url);
}
};
......@@ -10,6 +10,7 @@
margin: 10px;
.point-statistics {
position: relative;
float: left;
width: 18%;
height: 100%;
......@@ -43,6 +44,15 @@
font-weight: bold;
}
}
.point-statistics-label {
position: absolute;
text-align: center;
font-size: 20px;
top: 40%;
right: 40%;
}
}
.point-month-ins {
......@@ -572,6 +582,7 @@
height: 100%;
.ant-table-scroll {
overflow: hidden;
height: 100%;
.ant-table-body {
......
......@@ -76,10 +76,10 @@ class CommonTable extends Component {
*/
getHeader = () => {
return <div>
<Button onClick={this.onAddClick} icon="add">
<Button onClick={this.onAddClick} disabled={!this.props.editable} icon="add">
添加
</Button>
<Button onClick={this.onDelClick} icon="remove">
<Button onClick={this.onDelClick} disabled={!this.props.editable} icon="remove">
删除
</Button>
</div>;
......
......@@ -103,7 +103,7 @@ class FireEquipmentModel extends Component {
this.setState({ form: data });
});
}
getRiskSourceSecondLevelDate = () =>{
getRiskSourceSecondLevelAction().then(
data =>{
......@@ -247,9 +247,9 @@ class FireEquipmentModel extends Component {
onChange={e => this.onSelectChange('riskSourceId', e)}
/>
</FormItem>
<FormItem label={<span>区域</span>} field="productionArea" {...formItemLayout}>
{/* <FormItem label={<span>区域</span>} field="productionArea" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.productionArea} onChange={e => this.onInputChange('productionArea', e.target.value)} />
</FormItem>
</FormItem> */}
<FormItem label={<span>房间号</span>} field="room" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.room} onChange={e => this.onInputChange('room', e.target.value)} />
</FormItem>
......
......@@ -376,7 +376,7 @@ class FireEquipmentView extends Component {
this.editCancel();
},
error => {
AmosAlert.error('错误', '保存失败');
AmosAlert.error('错误', error || '保存失败');
}
);
} else {
......
......@@ -34,20 +34,22 @@ class FireTruckDetailInfo extends Component {
imgFiles: [],
previewVisible: false,
previewImage: '',
isDisabled: false
isDisabled: false,
editable: false
};
}
componentDidMount() {
let { fireCarId } = this.props.location.state || {};
let { fireCarId,editable } = this.props.location.state || {};
this.setState({ editable });
fireCarId && this.getFireTruckData(fireCarId);
}
componentWillReceiveProps(nextProps) {
if (nextProps && nextProps.location.state) {
let { fireCarId } = nextProps.location.state || {};
let { fireCarId,editable } = nextProps.location.state || {};
fireCarId && this.getFireTruckData(fireCarId);
this.setState({ imgFiles: [] });
this.setState({ imgFiles: [], editable });
}
}
......@@ -265,9 +267,12 @@ class FireTruckDetailInfo extends Component {
<div className="fire-resource-truck-detail-button">
<Button icon={<BizIcon icon="fanhui" />} transparent onClick={() => this.goBack()} />
<div className="fire-resource-commit-button">
<Button icon="ok" disabled={isDisabled || editable} onClick={() => this.submitData()} transparent>
提交
</Button>
{
editable &&
<Button icon="ok" disabled={isDisabled} onClick={() => this.submitData()} transparent>
提交
</Button>
}
</div>
</div>
<div className="fire-resource-truck-detail-info-content">
......@@ -289,11 +294,11 @@ class FireTruckDetailInfo extends Component {
</div>
<div className="fire-truck-performance2">
<div className="fire-truck-performance-title">车辆基本信息</div>
<FireTruckModel truckInfo={truckInfo} updateFireCarState={this.updateFireCarState} ref={model => (this.model = model)} />
<FireTruckModel truckInfo={truckInfo} editable={editable} updateFireCarState={this.updateFireCarState} ref={model => (this.model = model)} />
</div>
<div className="fire-truck-performance3">
<div className="fire-truck-performance-title">车辆性能信息</div>
<CommonTable tableData={dataList} onChangeTableValues={this.onChangeTableValues} columns={this.fireTruckTableColumns()} />
<CommonTable tableData={dataList} editable={editable} onChangeTableValues={this.onChangeTableValues} columns={this.fireTruckTableColumns()} />
</div>
</div>
</div>
......
......@@ -115,7 +115,7 @@ class FireTruckModel extends Component {
<Form model={form} rules={rules} ref={component => this.form = component}>
<div className='important-equipment-edit'>
<FormItem label={<span>车辆名称</span>} field="name" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.name} onChange={e => this.onInputChange('name', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.name} onChange={e => this.onInputChange('name', e.target.value)} />
</FormItem>
<FormItem label={<span>部门</span>} field="deptId" {...formItemLayout}>
<Select
......@@ -126,13 +126,14 @@ class FireTruckModel extends Component {
defaultOption={<Option value={-1}>{'请选择'}</Option>}
value={form.deptId}
onChange={e => this.onSelectChange('deptId', e)}
disabled={!this.props.editable}
/>
</FormItem>
<FormItem label={<span>发动机号</span>} field="engineNum" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.engineNum} onChange={e => this.onInputChange('engineNum', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.engineNum} onChange={e => this.onInputChange('engineNum', e.target.value)} />
</FormItem>
<FormItem label={<span>车辆状态</span>} field="state" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.state} onChange={e => this.onInputChange('state', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.state} onChange={e => this.onInputChange('state', e.target.value)} />
</FormItem>
<FormItem label={<span>所属区域</span>} field="riskSourceId" {...formItemLayout}>
......@@ -144,11 +145,12 @@ class FireTruckModel extends Component {
placeholder = "请选择"
value={form.riskSourceId}
onChange={e => this.onSelectChange('riskSourceId', e)}
disabled={!this.props.editable}
/>
</FormItem>
<FormItem label={<span>3维坐标</span>} field="position3d" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.position3d} onChange={e => this.onInputChange('position3d', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.position3d} onChange={e => this.onInputChange('position3d', e.target.value)} />
</FormItem>
<FormItem label={<span>3维楼层</span>} field="floor3d" {...formItemLayout}>
<Select
......@@ -158,28 +160,29 @@ class FireTruckModel extends Component {
value={form.floor3d}
renderOption={item => <Option value={item.id}>{item.name}</Option>}
onChange={e => this.onInputChange('floor3d', e)}
disabled={!this.props.editable}
/>
</FormItem>
<FormItem label={<span>是否室内</span>} field="isIndoor" {...formItemLayout}>
<RadioGroup defaultValue={form.isIndoor} value={form.isIndoor} onChange={e => this.onInputChange('isIndoor', e)}>
<RadioGroup defaultValue={form.isIndoor} disabled={!this.props.editable} value={form.isIndoor} onChange={e => this.onInputChange('isIndoor', e)}>
<Radio value={false}></Radio>
<Radio value={true}></Radio>
</RadioGroup>
</FormItem>
<FormItem label={<span>车牌号</span>} field="carNum" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.carNum} onChange={e => this.onInputChange('carNum', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.carNum} onChange={e => this.onInputChange('carNum', e.target.value)} />
</FormItem>
<FormItem label={<span>车辆类别</span>} field="type" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.type} onChange={e => this.onInputChange('type', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.type} onChange={e => this.onInputChange('type', e.target.value)} />
</FormItem>
<FormItem label={<span>厂牌型号</span>} field="model" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.model} onChange={e => this.onInputChange('model', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.model} onChange={e => this.onInputChange('model', e.target.value)} />
</FormItem>
<FormItem label={<span>国别</span>} field="country" {...formItemLayout}>
<Input className="risk_factor_input" required value={form.country} onChange={e => this.onInputChange('country', e.target.value)} />
<Input className="risk_factor_input" required disabled={!this.props.editable} value={form.country} onChange={e => this.onInputChange('country', e.target.value)} />
</FormItem>
<FormItem label={<span>备注</span>} field="remark" {...formItemLayout}>
<TextArea rows={10} cols={20} className="risk_factor_input" required value={form.remark} onChange={e => this.onInputChange('remark', e.target.value)} />
<TextArea rows={10} cols={20} className="risk_factor_input" required disabled={!this.props.editable} value={form.remark} onChange={e => this.onInputChange('remark', e.target.value)} />
</FormItem>
</div>
</Form>
......
......@@ -115,7 +115,7 @@ class FireTruckView extends Component {
onDetailClick = record => {
let path = {
pathname: fireTruckInfoPath,
state: { fireCarId: record.id }
state: { fireCarId: record.id, editable: false }
};
browserHistory.push(path);
};
......@@ -186,7 +186,7 @@ class FireTruckView extends Component {
add() {
let path = {
pathname: fireTruckInfoPath,
state: { toolbarFlag: 0 }
state: { toolbarFlag: 0, editable: true }
};
browserHistory.push(path);
};
......@@ -207,7 +207,9 @@ class FireTruckView extends Component {
pathname: fireTruckInfoPath,
state: {
toolbarFlag: 1,
fireCarId: fireCarId }
fireCarId: fireCarId,
editable: true
}
};
browserHistory.push(path);
}
......
......@@ -322,7 +322,7 @@ class FireFoamable extends Component {
that.setState({ isClick: true });   // 将isClick设置为true
}, 4000);
}
}
saveFireStation(station) {
......@@ -349,10 +349,14 @@ class FireFoamable extends Component {
body: formData
})
.then(e => {
AmosAlert.success('提示', '保存成功');
this.cancel();
// this.getFireStationData(this.pageConfig);
this.state.reload();
if (e.status === 200 ){
AmosAlert.success('提示', '保存成功');
this.cancel();
// this.getFireStationData(this.pageConfig);
this.state.reload();
} else {
AmosAlert.error('错误', '保存失败,请检查编号是否重复!');
}
})
.catch(e => {
AmosAlert.error('错误', '保存失败');
......
......@@ -22,6 +22,7 @@ const matchEquipmentTableColumns = self => {
return [
{
title: '序号',
width: '5%',
render: (text, record, index) => `${index + 1}`
},
{
......@@ -34,7 +35,7 @@ const matchEquipmentTableColumns = self => {
title: '名称',
dataIndex: 'name',
key: 'name',
width: '15%'
width: '10%'
},
// {
// title: '厂商',
......@@ -53,13 +54,13 @@ const matchEquipmentTableColumns = self => {
title: '类型',
dataIndex: 'equip_type',
key: 'equip_type',
width: '15%'
width: '10%'
},
{
title: '所属区域',
dataIndex: 'riskSourceName',
key: 'riskSourceName',
width: '15%'
width: '20%'
},
{
title: '楼层',
......@@ -71,7 +72,7 @@ const matchEquipmentTableColumns = self => {
title: '房间',
dataIndex: 'room',
key: 'room',
width: '15%'
width: '10%'
},
{
title: '数量',
......@@ -83,7 +84,7 @@ const matchEquipmentTableColumns = self => {
title: '单位',
dataIndex: 'unit',
key: 'unit',
width: '6%'
width: '5%'
}
];
};
......
......@@ -50,22 +50,22 @@ class CurDangerCount extends Component {
itemStyle: {
normal: {
label: {
show: true,
position: 'center',
formatter: function(params) {
let name = params.name;
if (name === '处理中') {
return '{a|' + params.value + '}' + '\r\n' + '{a|' + params.name + '}';
} else {
return '';
}
},
rich: {
a: {
fontSize: '20',
color: 'black' //'#ffffff'
}
}
show: false,
// position: 'center',
// formatter: function(params) {
// let name = params.name;
// if (name === '处理中') {
// return '{a|' + params.value + '}' + '\r\n' + '{a|' + params.name + '}';
// } else {
// return '';
// }
// },
// rich: {
// a: {
// fontSize: '20',
// color: 'black' //'#ffffff'
// }
// }
},
labelLine: {
show: false
......@@ -103,6 +103,7 @@ class CurDangerCount extends Component {
timeOut = e.value;
}
});
const processing = data && data.find(e => e.name === '处理中');
return (
<div className="point-statistics">
<div className="point-statistics-title">当前隐患治理情况</div>
......@@ -110,6 +111,13 @@ class CurDangerCount extends Component {
<div className="point-statistics-concent">
已超时:<span>{timeOut}</span>
</div>
{
processing && processing.value > 0 &&
<div className="point-statistics-label">
{processing.value} <br/>
{processing.name}
</div>
}
</div>
);
}
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { getOnlineWeather } from './../../../services/commonServices';
import { message } from 'amos-framework';
import { getOnlineWeather,getWeatherCityCode } from './../../../services/commonServices';
class Weather extends Component {
......@@ -22,9 +23,14 @@ class Weather extends Component {
}
getWeatherInfo = () => {
const { address } = this.props;
getOnlineWeather(address).then((res) => {
this.parseData(res.data);
let { address } = this.props;
getWeatherCityCode().then(citys => {
const curCity = citys.find( e => e.city_name.indexOf(address) > -1 );
getOnlineWeather(curCity.city_code).then((res) => {
this.parseData(res.data);
},error => {
message.danger(`天气(${address})查询失败!`);
});
});
}
......@@ -32,10 +38,10 @@ class Weather extends Component {
const { forecast = [] } = data;
const current = forecast[0];
if (current){
const fengli = current.fengli.replace('<![CDATA\[', '').replace(']]>', '');
// const fengli = current.fengli.replace('<![CDATA\[', '').replace(']]>', '');
const high = current.high.replace('高温', '').trim();
const low = current.low.replace('低温', '').trim();
const weatherInfo = `${current.type} ${low}~${high} ${current.fengxiang} ${fengli}`;
const weatherInfo = `${current.type} ${low}~${high} ${current.fx} ${current.fl}`;
this.setState({
weatherInfo
});
......
......@@ -164,7 +164,9 @@ class RegionSelect extends Component {
let { departments = [], roles = [] } = this.state;
if (key === 'company') {
reginParams.company = companys.find(item => item.sequenceNbr === value);
let company = companys.find(item => item.sequenceNbr === value);
reginParams.company = company;
reginParams.address = company.address;
departments = companyDepartments[value];
roles = orgRoles[value];
}
......
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