Merge branch 'master' of http://118.178.224.202:3000/ewide/ewide_core
This commit is contained in:
@@ -167,10 +167,10 @@ export default class index extends Component {
|
||||
const searchInfo = getSearchInfo({
|
||||
query,
|
||||
queryType: {
|
||||
no: '=',
|
||||
areaCode: '=',
|
||||
houseCode: 'like',
|
||||
type: '=',
|
||||
address: 'like',
|
||||
houseCode: 'like',
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -19,6 +19,18 @@ import moment from 'moment'
|
||||
import { CITY } from 'util/global'
|
||||
import store from 'store'
|
||||
|
||||
const initialValues = {
|
||||
houseInfo: {
|
||||
houseUsedStatus: 1,
|
||||
landAttribute: 1,
|
||||
curtainWall: 0,
|
||||
faceBrick: 0,
|
||||
coating: 0,
|
||||
painting: 0,
|
||||
elevator: '0',
|
||||
},
|
||||
}
|
||||
|
||||
const { getState, dispatch } = store
|
||||
|
||||
const layout = {
|
||||
@@ -32,6 +44,7 @@ export default class building extends Component {
|
||||
state = {
|
||||
loading: true,
|
||||
codes: {
|
||||
houseUsedStatus: [],
|
||||
landAttribute: [],
|
||||
houseStructureType: [],
|
||||
houseAseismicGrade: [],
|
||||
@@ -109,6 +122,7 @@ export default class building extends Component {
|
||||
}
|
||||
}
|
||||
_state.codes = await getDictData(
|
||||
'house_used_status',
|
||||
'land_attribute',
|
||||
'house_structure_type',
|
||||
'house_aseismic_grade',
|
||||
@@ -357,6 +371,7 @@ export default class building extends Component {
|
||||
return (
|
||||
<Spin spinning={loading} indicator={<AntIcon type="loading" />}>
|
||||
<Form
|
||||
initialValues={initialValues}
|
||||
{...layout}
|
||||
ref={this.form}
|
||||
onValuesChange={(changedValues, allValues) =>
|
||||
@@ -382,23 +397,39 @@ export default class building extends Component {
|
||||
<Input autoComplete="off" placeholder="请输入坐落地址" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="房屋使用状态"
|
||||
name={['houseInfo', 'houseUsedStatus']}
|
||||
rules={[{ required: true, message: '请选择房屋使用状态' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.houseUsedStatus.map(item => (
|
||||
<Radio.Button key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Radio.Button>
|
||||
))}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
label="土地性质"
|
||||
name={['houseInfo', 'landAttribute']}
|
||||
rules={[{ required: true, message: '请选择土地性质' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.landAttribute.map(item => {
|
||||
return (
|
||||
<Radio.Button key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Radio.Button>
|
||||
)
|
||||
})}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Form.Item
|
||||
label="土地性质"
|
||||
name={['houseInfo', 'landAttribute']}
|
||||
rules={[{ required: true, message: '请选择土地性质' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.landAttribute.map(item => {
|
||||
return (
|
||||
<Radio.Button key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Radio.Button>
|
||||
)
|
||||
})}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item className="mb-none" label="地理坐标" required>
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
@@ -681,118 +712,6 @@ export default class building extends Component {
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="总户数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'houseHolds']}
|
||||
rules={[{ required: true, message: '请输入总户数' }]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入总户数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">户</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="房屋单元数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'units']}
|
||||
rules={[
|
||||
{ required: true, message: '请输入房屋单元数' },
|
||||
]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入房屋单元数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">单元</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="每层每单元户数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'unitFloorHolds']}
|
||||
rules={[
|
||||
{ required: true, message: '请输入每层每单元户数' },
|
||||
]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入每层每单元户数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">户</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="建设单位" name={['houseInfo', 'buildingUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label="建设单位联系人"
|
||||
name={['houseInfo', 'buildingUnitUser']}
|
||||
>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位联系人" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label="建设单位联系电话"
|
||||
name={['houseInfo', 'buildingUnitTel']}
|
||||
>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位联系电话" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="设计单位" name={['houseInfo', 'desingerUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入设计单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="施工单位" name={['houseInfo', 'constructionUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入施工单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="监理单位" name={['houseInfo', 'monitorUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入监理单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item label="建筑层数" className="mb-none">
|
||||
<Row>
|
||||
@@ -916,6 +835,118 @@ export default class building extends Component {
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="总户数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'houseHolds']}
|
||||
rules={[{ required: true, message: '请输入总户数' }]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入总户数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">户</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="房屋单元数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'units']}
|
||||
rules={[
|
||||
{ required: true, message: '请输入房屋单元数' },
|
||||
]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入房屋单元数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">单元</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="每层每单元户数" required>
|
||||
<Row align="middle">
|
||||
<Col flex="1">
|
||||
<Form.Item
|
||||
name={['houseInfo', 'unitFloorHolds']}
|
||||
rules={[
|
||||
{ required: true, message: '请输入每层每单元户数' },
|
||||
]}
|
||||
noStyle
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
precision={0}
|
||||
step={1}
|
||||
className="w-100-p"
|
||||
placeholder="请输入每层每单元户数"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col>
|
||||
<span className="yo-addon">户</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="建设单位" name={['houseInfo', 'buildingUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label="建设单位联系人"
|
||||
name={['houseInfo', 'buildingUnitUser']}
|
||||
>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位联系人" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item
|
||||
label="建设单位联系电话"
|
||||
name={['houseInfo', 'buildingUnitTel']}
|
||||
>
|
||||
<Input autoComplete="off" placeholder="请输入建设单位联系电话" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="设计单位" name={['houseInfo', 'desingerUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入设计单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="施工单位" name={['houseInfo', 'constructionUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入施工单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="监理单位" name={['houseInfo', 'monitorUnit']}>
|
||||
<Input autoComplete="off" placeholder="请输入监理单位" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Spin>
|
||||
|
||||
@@ -135,7 +135,7 @@ export default class identification extends Component {
|
||||
))}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
{/* <Form.Item
|
||||
label="综合等级"
|
||||
name={['houseInfo', 'houseGrade']}
|
||||
rules={[{ required: true, message: '请选择综合等级' }]}
|
||||
@@ -147,7 +147,7 @@ export default class identification extends Component {
|
||||
</Radio.Button>
|
||||
))}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
</Form.Item> */}
|
||||
</Form>
|
||||
</Spin>
|
||||
)
|
||||
|
||||
@@ -13,14 +13,14 @@ const parts = [
|
||||
title: '权属情况',
|
||||
component: () => import('./ownership'),
|
||||
},
|
||||
{
|
||||
title: '调查情况',
|
||||
component: () => import('./investigation'),
|
||||
},
|
||||
{
|
||||
title: '鉴定治理',
|
||||
component: () => import('./identification'),
|
||||
},
|
||||
// {
|
||||
// title: '调查情况',
|
||||
// component: () => import('./investigation'),
|
||||
// },
|
||||
// {
|
||||
// title: '鉴定治理',
|
||||
// component: () => import('./identification'),
|
||||
// },
|
||||
{
|
||||
title: '图纸资料存档处',
|
||||
component: () => import('./drawing'),
|
||||
|
||||
@@ -4,7 +4,18 @@ import { AntIcon } from 'components'
|
||||
import { cloneDeep, first, isEqual, last, sortBy } from 'lodash'
|
||||
import getDictData from 'util/dic'
|
||||
|
||||
const initialValues = {}
|
||||
const initialValues = {
|
||||
houseInfo: {
|
||||
houseSite: ['1'],
|
||||
adjacentConstruction: ['0'],
|
||||
chemicalErosion: ['0'],
|
||||
structuralDismantling: 0,
|
||||
addingLayer: 0,
|
||||
repairAndReinforce: ['0'],
|
||||
historicalCalamity: ['0'],
|
||||
functionalChange: ['0'],
|
||||
},
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { flex: '150px' },
|
||||
|
||||
@@ -4,7 +4,18 @@ import { AntIcon } from 'components'
|
||||
import { cloneDeep, isEqual } from 'lodash'
|
||||
import getDictData from 'util/dic'
|
||||
|
||||
const initialValues = {}
|
||||
const initialValues = {
|
||||
houseInfo: {
|
||||
straightHouseCount: 0,
|
||||
selfHouseCount: 0,
|
||||
privateHouseCount: 0,
|
||||
businessCount: 0,
|
||||
changeHouseCount: 0,
|
||||
resettlementHouseCount: 0,
|
||||
otherCount: 0,
|
||||
houseCount: 0,
|
||||
},
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { flex: '150px' },
|
||||
@@ -151,7 +162,11 @@ export default class ownership extends Component {
|
||||
this.onValuesChange(changedValues, allValues)
|
||||
}
|
||||
>
|
||||
<Form.Item label="产权性质" name={['houseInfo', 'propertyRights']}>
|
||||
<Form.Item
|
||||
label="产权性质"
|
||||
name={['houseInfo', 'propertyRights']}
|
||||
rules={[{ required: true, message: '请选择产权性质' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.housePropertyRights.map(item => (
|
||||
<Radio.Button key={item.code} value={item.code}>
|
||||
|
||||
@@ -87,6 +87,20 @@ export default class index extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
// 获取详细数据
|
||||
this.onLoadInitData()
|
||||
}
|
||||
|
||||
call(child, index) {
|
||||
this.children[index] = child
|
||||
if (this.children.filter(p => p).length === tabs.filter(p => p.show).length) {
|
||||
this.setState({ saveDisabled: false })
|
||||
}
|
||||
}
|
||||
|
||||
onLoadInitData() {
|
||||
this.setState({
|
||||
loading: true,
|
||||
})
|
||||
const { taskId } = this.props.param
|
||||
if (taskId) {
|
||||
api.houseInfoGetByTaskId({ taskId }).then(({ data }) => {
|
||||
@@ -103,13 +117,6 @@ export default class index extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
call(child, index) {
|
||||
this.children[index] = child
|
||||
if (this.children.filter(p => p).length === tabs.filter(p => p.show).length) {
|
||||
this.setState({ saveDisabled: false })
|
||||
}
|
||||
}
|
||||
|
||||
async onSave() {
|
||||
await this.onPostData(actions.save)
|
||||
}
|
||||
@@ -180,7 +187,7 @@ export default class index extends Component {
|
||||
if (success) {
|
||||
Message.success(action.remark + '成功')
|
||||
this.setState({ saving: false })
|
||||
if (this.props.param.table) {
|
||||
if (this.props.param.table.current) {
|
||||
this.props.param.table.current.onReloadData()
|
||||
}
|
||||
switch (action.after) {
|
||||
@@ -188,7 +195,7 @@ export default class index extends Component {
|
||||
window.closeContentWindow()
|
||||
break
|
||||
default:
|
||||
this.componentDidMount()
|
||||
this.onLoadInitData()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ const parts = [
|
||||
title: '等级划分',
|
||||
component: () => import('./grade'),
|
||||
},
|
||||
{
|
||||
title: '调查情况',
|
||||
component: () => import('./investigation'),
|
||||
},
|
||||
{
|
||||
title: '处理情况',
|
||||
component: () => import('./handling'),
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Checkbox, Form, Input, Radio, Spin } from 'antd'
|
||||
import { AntIcon } from 'components'
|
||||
import { cloneDeep, first, isEqual, last, sortBy } from 'lodash'
|
||||
import getDictData from 'util/dic'
|
||||
|
||||
const initialValues = {
|
||||
patrolInfo: {
|
||||
houseSite: ['1'],
|
||||
adjacentConstruction: ['0'],
|
||||
chemicalErosion: ['0'],
|
||||
structuralDismantling: 0,
|
||||
addingLayer: 0,
|
||||
repairAndReinforce: ['0'],
|
||||
historicalCalamity: ['0'],
|
||||
functionalChange: ['0'],
|
||||
},
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { flex: '150px' },
|
||||
wrapperCol: { flex: '1' },
|
||||
}
|
||||
|
||||
const checkboxKeys = [
|
||||
'houseSite',
|
||||
'adjacentConstruction',
|
||||
'chemicalErosion',
|
||||
'repairAndReinforce',
|
||||
'historicalCalamity',
|
||||
'functionalChange',
|
||||
]
|
||||
|
||||
export default class investigation extends Component {
|
||||
state = {
|
||||
loading: true,
|
||||
codes: {
|
||||
houseHouseSite: [],
|
||||
houseAdjacentConstruction: [],
|
||||
houseChemicalErosion: [],
|
||||
houseStructuralDismantling: [],
|
||||
houseAddingLayer: [],
|
||||
houseRepairAndReinforce: [],
|
||||
houseHistoricalCalamity: [],
|
||||
houseFunctionalChange: [],
|
||||
},
|
||||
options: {},
|
||||
}
|
||||
|
||||
// 表单实例
|
||||
form = React.createRef()
|
||||
|
||||
// 初始化数据
|
||||
record = {}
|
||||
|
||||
/**
|
||||
* 阻止外部组件引发的渲染,提升性能
|
||||
* 可自行添加渲染条件
|
||||
* [必要]
|
||||
* @param {*} props
|
||||
* @param {*} state
|
||||
* @returns
|
||||
*/
|
||||
shouldComponentUpdate(props, state) {
|
||||
return !isEqual(this.state, state)
|
||||
}
|
||||
|
||||
/**
|
||||
* DOM加载完成钩子,绑定数据
|
||||
*/
|
||||
componentDidMount() {
|
||||
this.fillData({
|
||||
record: this.props.record,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载完成,通知父级组件并传递自身
|
||||
*/
|
||||
call() {
|
||||
const { onRef } = this.props
|
||||
if (onRef) onRef(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充数据
|
||||
* 可以在设置this.record之后对其作出数据结构调整
|
||||
* [异步,必要]
|
||||
* @param {*} params
|
||||
*/
|
||||
async fillData(params) {
|
||||
this.record = cloneDeep(params.record)
|
||||
//#region 从后端转换成前段所需格式
|
||||
if (this.record) {
|
||||
const { patrolInfo } = this.record
|
||||
// checkbox
|
||||
checkboxKeys.forEach(key => {
|
||||
if (patrolInfo[key]) {
|
||||
patrolInfo[key] = patrolInfo[key].split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
const codes = await getDictData(
|
||||
'house_house_site',
|
||||
'house_adjacent_construction',
|
||||
'house_chemical_erosion',
|
||||
'house_structural_dismantling',
|
||||
'house_adding_layer',
|
||||
'house_repair_and_reinforce',
|
||||
'house_historical_calamity',
|
||||
'house_functional_change'
|
||||
)
|
||||
this.setState({ codes })
|
||||
//#endregion
|
||||
this.form.current.setFieldsValue(this.record)
|
||||
|
||||
this.setState({ loading: false })
|
||||
this.call()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
* 可以对postData进行数据结构调整
|
||||
* [异步,必要]
|
||||
* @returns
|
||||
*/
|
||||
async getData() {
|
||||
const form = this.form.current
|
||||
|
||||
const valid = await form.validateFields()
|
||||
if (valid) {
|
||||
const postData = form.getFieldsValue()
|
||||
//#region 从前段转换后端所需格式
|
||||
const { patrolInfo } = postData
|
||||
// checkbox
|
||||
checkboxKeys.forEach(key => {
|
||||
if (patrolInfo[key]) {
|
||||
patrolInfo[key] = sortBy(patrolInfo[key], p => +p).join(',')
|
||||
}
|
||||
})
|
||||
//#endregion
|
||||
return postData
|
||||
}
|
||||
}
|
||||
|
||||
//#region 自定义方法
|
||||
/**
|
||||
* 表单change事件处理,包括了所有字段的change
|
||||
* [异步,非必要]
|
||||
* @param {*} changedValues
|
||||
* @param {*} allValues
|
||||
*/
|
||||
async onValuesChange(changedValues, allValues) {
|
||||
const { patrolInfo } = changedValues
|
||||
const key = Object.keys(patrolInfo).shift()
|
||||
if (
|
||||
[
|
||||
'adjacentConstruction',
|
||||
'chemicalErosion',
|
||||
'repairAndReinforce',
|
||||
'historicalCalamity',
|
||||
'functionalChange',
|
||||
].includes(key)
|
||||
) {
|
||||
this.checkedNone(patrolInfo[key], key)
|
||||
}
|
||||
}
|
||||
|
||||
checkedNone(value, key) {
|
||||
const form = this.form.current
|
||||
if (first(value) == 0 && value.length > 1) {
|
||||
// 在'无'之后选中其他值
|
||||
value.shift()
|
||||
form.setFieldsValue({
|
||||
patrolInfo: { [key]: value },
|
||||
})
|
||||
} else if (last(value) == 0 && value.length > 1) {
|
||||
// 在其他值之后选中'无'
|
||||
value = ['0']
|
||||
form.setFieldsValue({
|
||||
patrolInfo: { [key]: value },
|
||||
})
|
||||
}
|
||||
return value
|
||||
}
|
||||
//#endregion
|
||||
|
||||
render() {
|
||||
const { loading, codes } = this.state
|
||||
|
||||
return (
|
||||
<Spin spinning={loading} indicator={<AntIcon type="loading" />}>
|
||||
<Form
|
||||
initialValues={initialValues}
|
||||
ref={this.form}
|
||||
{...layout}
|
||||
onValuesChange={(changedValues, allValues) =>
|
||||
this.onValuesChange(changedValues, allValues)
|
||||
}
|
||||
>
|
||||
<Form.Item
|
||||
label="房屋场地"
|
||||
name={['patrolInfo', 'houseSite']}
|
||||
rules={[{ required: true, message: '请选择房屋场地' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseHouseSite.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="相邻施工"
|
||||
name={['patrolInfo', 'adjacentConstruction']}
|
||||
rules={[{ required: true, message: '请选择相邻施工' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseAdjacentConstruction.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="化学侵蚀"
|
||||
name={['patrolInfo', 'chemicalErosion']}
|
||||
rules={[{ required: true, message: '请选择化学侵蚀' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseChemicalErosion.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="结构拆改"
|
||||
name={['patrolInfo', 'structuralDismantling']}
|
||||
rules={[{ required: true, message: '请选择结构拆改' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.houseStructuralDismantling.map(item => (
|
||||
<Radio.Button key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Radio.Button>
|
||||
))}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="加层改造"
|
||||
name={['patrolInfo', 'addingLayer']}
|
||||
rules={[{ required: true, message: '请选择加层改造' }]}
|
||||
>
|
||||
<Radio.Group buttonStyle="solid">
|
||||
{codes.houseAddingLayer.map(item => (
|
||||
<Radio.Button key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Radio.Button>
|
||||
))}
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="修缮加固"
|
||||
name={['patrolInfo', 'repairAndReinforce']}
|
||||
rules={[{ required: true, message: '请选择修缮加固' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseRepairAndReinforce.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="历史灾害"
|
||||
name={['patrolInfo', 'historicalCalamity']}
|
||||
rules={[{ required: true, message: '请选择历史灾害' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseHistoricalCalamity.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="使用功能变更"
|
||||
name={['patrolInfo', 'functionalChange']}
|
||||
rules={[{ required: true, message: '请选择使用功能变更' }]}
|
||||
>
|
||||
<Checkbox.Group>
|
||||
{codes.houseFunctionalChange.map(item => (
|
||||
<Checkbox key={item.code} value={item.code}>
|
||||
{item.value}
|
||||
</Checkbox>
|
||||
))}
|
||||
</Checkbox.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label="其他调查内容" name={['patrolInfo', 'otherContents']}>
|
||||
<Input.TextArea autoSize placeholder="请输入其他调查内容" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Spin>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user