fix 区域树
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Form, Button, Table, Tooltip } from 'antd'
|
||||
import { AntIcon } from 'components'
|
||||
import { isEqual } from 'lodash'
|
||||
|
||||
const propsMap = ['columns', 'autoLoad', 'loadData', 'pageIndex', 'pageSize']
|
||||
|
||||
@@ -157,6 +158,10 @@ export default class QueryTable extends Component {
|
||||
onLoadData = async () => {
|
||||
this.onLoading()
|
||||
|
||||
if (isEqual(this.query, {})) {
|
||||
this.query = this.props.queryInitialValues
|
||||
}
|
||||
|
||||
const res = await this.loadData(
|
||||
{
|
||||
pageIndex: this.pagination.current,
|
||||
|
||||
@@ -87,7 +87,8 @@ export default class form extends Component {
|
||||
this.record = {
|
||||
pid: params.pid,
|
||||
...this.record,
|
||||
areaCode: areaCode.length == 4 ? areaCode : [],
|
||||
areaCode:
|
||||
areaCode.length > 0 && areaCode[areaCode.length - 1].length == 12 ? areaCode : [],
|
||||
}
|
||||
//#endregion
|
||||
|
||||
@@ -213,6 +214,7 @@ export default class form extends Component {
|
||||
rules={[{ required: true, message: '请选择所属区域' }]}
|
||||
>
|
||||
<Cascader
|
||||
disabled={this.state.exist}
|
||||
options={this.state.options.areaData}
|
||||
fieldNames={{
|
||||
label: 'name',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Button, Card, Form, Input, message as Message, Popconfirm } from 'antd'
|
||||
import { Button, Radio, Card, Form, Input, message as Message, Popconfirm } from 'antd'
|
||||
import {
|
||||
AntIcon,
|
||||
Auth,
|
||||
@@ -31,6 +31,7 @@ export default class index extends Component {
|
||||
codes: {
|
||||
houseType: [],
|
||||
},
|
||||
type: 1,
|
||||
}
|
||||
|
||||
// 表格实例
|
||||
@@ -246,8 +247,27 @@ export default class index extends Component {
|
||||
autoLoad={false}
|
||||
loadData={this.loadData}
|
||||
columns={this.columns}
|
||||
queryInitialValues={{
|
||||
type: 1,
|
||||
}}
|
||||
onQueryChange={values => {
|
||||
if (values.hasOwnProperty('type')) {
|
||||
this.setState({ type: values.type })
|
||||
}
|
||||
}}
|
||||
query={
|
||||
<Auth auth="houseProjectInfo:page">
|
||||
<Form.Item label="项目类型" name="type">
|
||||
<Radio.Group buttonStyle="solid">
|
||||
<Radio.Button value={0}>全部</Radio.Button>
|
||||
<Radio.Button value={1}>
|
||||
<span>住宅</span>
|
||||
</Radio.Button>
|
||||
<Radio.Button value={2}>
|
||||
<span>非住宅</span>
|
||||
</Radio.Button>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item label="项目名称" name="name">
|
||||
<Input autoComplete="off" placeholder="请输入项目名称" />
|
||||
</Form.Item>
|
||||
|
||||
Reference in New Issue
Block a user