Commit 8b039539 authored by zhengjiawei's avatar zhengjiawei

功能调整

parent df16262d
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
//地图zoom显示级别 //地图zoom显示级别
// showZoom: [7, 13, 18], // showZoom: [7, 13, 18],
//离线地图地址 //离线地图地址
picURI: 'http://172.16.9.20:9090/' picURI: 'http://172.16.3.121:8001/shanxi/amap'
}; };
// 配置日志系统 // 配置日志系统
......
...@@ -15,13 +15,20 @@ const getColumns = () => { ...@@ -15,13 +15,20 @@ const getColumns = () => {
title: '设备编号', title: '设备编号',
dataIndex: 'fireEquipmentCode', dataIndex: 'fireEquipmentCode',
key: 'fireEquipmentCode', key: 'fireEquipmentCode',
width: '12%', width: '10%',
className: 'uant-table-thead' className: 'uant-table-thead'
}, },
{ {
title: '设备名称', title: '设备名称',
dataIndex: 'fireEquipmentName', dataIndex: 'fireEquipmentName',
key: 'fireEquipmentName', key: 'fireEquipmentName',
width: '20%',
className: 'uant-table-thead'
},
{
title: '所在区域',
dataIndex: 'source_name',
key: 'source_name',
width: '15%', width: '15%',
className: 'uant-table-thead' className: 'uant-table-thead'
}, },
...@@ -29,7 +36,7 @@ const getColumns = () => { ...@@ -29,7 +36,7 @@ const getColumns = () => {
title: '指标名称', title: '指标名称',
dataIndex: 'eq_point_name', dataIndex: 'eq_point_name',
key: 'eq_point_name', key: 'eq_point_name',
width: '20%', width: '10%',
className: 'uant-table-thead' className: 'uant-table-thead'
}, },
{ {
...@@ -57,14 +64,14 @@ const getColumns = () => { ...@@ -57,14 +64,14 @@ const getColumns = () => {
title: '保护对象', title: '保护对象',
dataIndex: 'equipmentName', dataIndex: 'equipmentName',
key: 'equipmentName', key: 'equipmentName',
width: '15%', width: '10%',
className: 'uant-table-thead' className: 'uant-table-thead'
}, },
{ {
title: '上报时间', title: '上报时间',
dataIndex: 'create_date', dataIndex: 'create_date',
key: 'create_date', key: 'create_date',
width: '15%', width: '20%',
render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'), render: text => moment(text).format('YYYY-MM-DD HH:mm:ss'),
className: 'uant-table-thead' className: 'uant-table-thead'
} }
......
...@@ -146,6 +146,10 @@ class StationMainten extends Component { ...@@ -146,6 +146,10 @@ class StationMainten extends Component {
const { form } = this.state; const { form } = this.state;
form.safetyChargeUserId = value; form.safetyChargeUserId = value;
} }
onSelectCaptainCharge = value => {
const { form } = this.state;
form.fireCaptainUserId = value;
}
// 行政划区选择 // 行政划区选择
onChangeAddress = (value, item) => { onChangeAddress = (value, item) => {
...@@ -274,12 +278,19 @@ class StationMainten extends Component { ...@@ -274,12 +278,19 @@ class StationMainten extends Component {
const { allUserList,form } = this.state; const { allUserList,form } = this.state;
const stationChargeName = allUserList.filter(item => item.userId === dataValues.stationChargeUserId )[0].realName; const stationChargeName = allUserList.filter(item => item.userId === dataValues.stationChargeUserId )[0].realName;
const safetyChargeName = allUserList.filter(item => item.userId === dataValues.safetyChargeUserId )[0].realName; const safetyChargeName = allUserList.filter(item => item.userId === dataValues.safetyChargeUserId )[0].realName;
const fireCaptainName = allUserList.filter(item => item.userId === dataValues.fireCaptainUserId )[0].realName;
const stationUserPhoneNum = allUserList.filter(item => item.userId === dataValues.stationChargeUserId )[0].mobile; const stationUserPhoneNum = allUserList.filter(item => item.userId === dataValues.stationChargeUserId )[0].mobile;
const safetyUserPhoneNum = allUserList.filter(item => item.userId === dataValues.safetyChargeUserId )[0].mobile; const safetyUserPhoneNum = allUserList.filter(item => item.userId === dataValues.safetyChargeUserId )[0].mobile;
const fireCaptainPhoneNum = allUserList.filter(item => item.userId === dataValues.fireCaptainUserId )[0].mobile;
dataValues.stationChargeUserName = stationChargeName; dataValues.stationChargeUserName = stationChargeName;
dataValues.safetyChargeUserName = safetyChargeName; dataValues.safetyChargeUserName = safetyChargeName;
dataValues.fireCaptainName = fireCaptainName;
dataValues.stationUserPhoneNum = stationUserPhoneNum; dataValues.stationUserPhoneNum = stationUserPhoneNum;
dataValues.safetyUserPhoneNum = safetyUserPhoneNum; dataValues.safetyUserPhoneNum = safetyUserPhoneNum;
dataValues.fireCaptainPhoneNum = fireCaptainPhoneNum;
dataValues.status = form.status; dataValues.status = form.status;
let param = dataValues; let param = dataValues;
addStationMaintenAction(param).then( addStationMaintenAction(param).then(
...@@ -366,6 +377,10 @@ class StationMainten extends Component { ...@@ -366,6 +377,10 @@ class StationMainten extends Component {
render() { render() {
const { form, rules, useTypeData, provinceData, cityData, countyData, allUserList, BasicMap,isCanEidt,canEdit,canlSHow } = this.state; const { form, rules, useTypeData, provinceData, cityData, countyData, allUserList, BasicMap,isCanEidt,canEdit,canlSHow } = this.state;
const lalng = {
longitude: form.longitude,
latitude: form.latitude
};
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
...@@ -460,10 +475,11 @@ class StationMainten extends Component { ...@@ -460,10 +475,11 @@ class StationMainten extends Component {
<span className="left-address-span">区县</span> <span className="left-address-span">区县</span>
</FormItem> </FormItem>
<FormItem label={<span>详细地址</span>} field="address" {...formItemLayout}> <FormItem label={<span>详细地址</span>} field="address" {...formItemLayout}>
<TextArea rows={5} <TextArea rows={3}
className="left-textArea" className="left-textArea"
disabled={!isCanEidt} disabled={!isCanEidt}
value={form.address} value={form.address}
disableResize
placeholder="详细地址" placeholder="详细地址"
onChange={e => this.onInputChange('address', e.target.value)} onChange={e => this.onInputChange('address', e.target.value)}
/> />
...@@ -510,6 +526,22 @@ class StationMainten extends Component { ...@@ -510,6 +526,22 @@ class StationMainten extends Component {
{!isCanEidt && form.status === 0 && <div className="text-div">{'启用'}</div>} {!isCanEidt && form.status === 0 && <div className="text-div">{'启用'}</div>}
{!isCanEidt && form.status === 1 && <div className="text-div">{'停用'}</div>} {!isCanEidt && form.status === 1 && <div className="text-div">{'停用'}</div>}
</FormItem> </FormItem>
<FormItem label={<span>驻站消防队队长</span>} field="fireCaptain" {...formItemLayout}>
<Row style={{ width: '400px' }}>
<Col span={9}>
<Select
data={allUserList}
field="fireCaptain"
className="left-station-select"
disabled={!isCanEidt}
value={form.fireCaptainUserId}
renderOption={item => <Option value={item.userId}>{item.realName}</Option>}
defaultOption={<Option>请选择</Option>}
onChange={this.onSelectCaptainCharge}
/>
</Col>
</Row>
</FormItem>
<FormItem label={<span>换流站负责人</span>} field="stationChargeUserName" {...formItemLayout}> <FormItem label={<span>换流站负责人</span>} field="stationChargeUserName" {...formItemLayout}>
<Row style={{ width: '400px' }}> <Row style={{ width: '400px' }}>
<Col span={9}> <Col span={9}>
...@@ -554,7 +586,7 @@ class StationMainten extends Component { ...@@ -554,7 +586,7 @@ class StationMainten extends Component {
<Col span={12} style={{ height: '614px', border: '1px solid black' }}> <Col span={12} style={{ height: '614px', border: '1px solid black' }}>
<div style={{ height: '614px' }}> <div style={{ height: '614px' }}>
{ /**this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} /> */} { /**this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} /> */}
{ this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} /> } { this.state.loadAmap && <BasicMap indexViewChange={this.indexViewChange} pushMarkerPoint={this.handleMarkerMap} lalng={lalng} isCanEidt={isCanEidt} /> }
</div> </div>
</Col> </Col>
</Row> </Row>
......
...@@ -26,7 +26,7 @@ const mapConfig = { ...@@ -26,7 +26,7 @@ const mapConfig = {
const layers = [ const layers = [
new window.AMap.TileLayer({ new window.AMap.TileLayer({
getTileUrl(x, y, z) { getTileUrl(x, y, z) {
return `${_picURI}${z}/${x}/${y}.png`; return `${_picURI}/${z}/${x}/${y}.png`;
}, },
zIndex: 0 zIndex: 0
}) })
...@@ -40,14 +40,16 @@ const layers = [ ...@@ -40,14 +40,16 @@ const layers = [
*/ */
class IndexMap extends Component { class IndexMap extends Component {
static propTypes = { static propTypes = {
pushMarkerPoint: PropTypes.func pushMarkerPoint: PropTypes.func,
lalng: PropTypes.object,
isCanEidt: PropTypes.bool
}; };
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
mapCenter: _mapCenter, mapCenter: _mapCenter,
center: { longitude: 101.90771484, latitude: 35.92184115 }, center: { longitude: 101.90771484, latitude: 35.92184115 },
marker: { longitude: 0, latitude: 0 }, marker: this.props.lalng || { longitude: 0, latitude: 0 },
// marker: { longitude: null, latitude: null }, // marker: { longitude: null, latitude: null },
visible: true, visible: true,
style: { strokeColor: '#10A100', fillColor: '#10A100' }, style: { strokeColor: '#10A100', fillColor: '#10A100' },
...@@ -69,6 +71,9 @@ class IndexMap extends Component { ...@@ -69,6 +71,9 @@ class IndexMap extends Component {
* @memberof IndexMap * @memberof IndexMap
*/ */
handleClickMap = e => { handleClickMap = e => {
if (!this.props.isCanEidt) {
return;
}
const { marker } = this.state; const { marker } = this.state;
marker.longitude = e.lnglat.lng; marker.longitude = e.lnglat.lng;
marker.latitude = e.lnglat.lat; marker.latitude = e.lnglat.lat;
...@@ -87,7 +92,7 @@ class IndexMap extends Component { ...@@ -87,7 +92,7 @@ class IndexMap extends Component {
if (outMap) { if (outMap) {
mapConfig.layers = layers; mapConfig.layers = layers;
} }
console.log(marker)
return ( return (
<div className="content indexPage" style={{ height: '612px' }}> <div className="content indexPage" style={{ height: '612px' }}>
<BaseMap events={events} center={mapCenter} {...mapConfig} > <BaseMap events={events} center={mapCenter} {...mapConfig} >
......
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