update 增加了查询分析详情页的文件
This commit is contained in:
35
web-react/src/pages/business/house/query/detail.jsx
Normal file
35
web-react/src/pages/business/house/query/detail.jsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import React, { Component } from 'react'
|
||||
import { Card } from 'antd'
|
||||
import Container from 'components/container'
|
||||
import { api } from 'common/api'
|
||||
import ReactJson from 'react-json-view'
|
||||
|
||||
export default class detail extends Component {
|
||||
state = {
|
||||
loading: false,
|
||||
record: null,
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// 获取详细数据
|
||||
const { id } = this.props.param
|
||||
if (id) {
|
||||
api.houseQueryDetail({ id }).then(({ data }) => {
|
||||
this.setState({
|
||||
record: data,
|
||||
loading: false,
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Container>
|
||||
<Card>
|
||||
<ReactJson src={this.state.record} />
|
||||
</Card>
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,14 @@ import {
|
||||
Row,
|
||||
Tag,
|
||||
} from 'antd'
|
||||
import { AntIcon, Auth, Container, InputNumberRange, QueryTable } from 'components'
|
||||
import {
|
||||
AntIcon,
|
||||
Auth,
|
||||
Container,
|
||||
InputNumberRange,
|
||||
QueryTable,
|
||||
QueryTableActions,
|
||||
} from 'components'
|
||||
import { api } from 'common/api'
|
||||
import auth from 'components/authorized/handler'
|
||||
import { first, isEqual, last } from 'lodash'
|
||||
@@ -46,6 +53,9 @@ const authName = 'houseQuery'
|
||||
export default class index extends Component {
|
||||
state = {
|
||||
codes: {
|
||||
houseStatus: [],
|
||||
houseType: [],
|
||||
houseIndustry: [],
|
||||
houseUsedStatus: [],
|
||||
housePropertyRights: [],
|
||||
landAttribute: [],
|
||||
@@ -95,10 +105,11 @@ export default class index extends Component {
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: '任务截止时间',
|
||||
dataIndex: 'endTime',
|
||||
title: '建档状态',
|
||||
dataIndex: 'state',
|
||||
sorter: true,
|
||||
width: 150,
|
||||
width: 100,
|
||||
render: text => this.bindCodeValue(text, 'house_status'),
|
||||
},
|
||||
]
|
||||
|
||||
@@ -109,7 +120,22 @@ export default class index extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
const flag = auth({ [authName]: [['edit'], ['delete']] })
|
||||
const flag = auth({ [authName]: 'detail' })
|
||||
|
||||
if (flag) {
|
||||
this.columns.push({
|
||||
title: '操作',
|
||||
width: 150,
|
||||
dataIndex: 'actions',
|
||||
render: (text, record) => (
|
||||
<QueryTableActions>
|
||||
<Auth auth={{ [authName]: 'detail' }}>
|
||||
<a onClick={() => this.onOpen(record.id)}>查看</a>
|
||||
</Auth>
|
||||
</QueryTableActions>
|
||||
),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,6 +158,9 @@ export default class index extends Component {
|
||||
const { onLoading, onLoadData } = this.table.current
|
||||
onLoading()
|
||||
getDictData(
|
||||
'house_status',
|
||||
'house_type',
|
||||
'house_industry',
|
||||
'house_used_status',
|
||||
'house_property_rights',
|
||||
'land_attribute',
|
||||
@@ -198,8 +227,12 @@ export default class index extends Component {
|
||||
* @param {*} modal
|
||||
* @param {*} id
|
||||
*/
|
||||
onOpen(modal, id) {
|
||||
modal.current.open({ id })
|
||||
onOpen(id) {
|
||||
window.openContentWindow({
|
||||
title: '房屋详情',
|
||||
path: 'business/house/query/detail',
|
||||
param: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,14 +28,7 @@ const authName = 'houseTask'
|
||||
export default class index extends Component {
|
||||
state = {
|
||||
codes: {
|
||||
status: [
|
||||
{ code: -1, value: '审核退回' },
|
||||
{ code: 0, value: '待处理' },
|
||||
{ code: 1, value: '暂存' },
|
||||
{ code: 2, value: '待提交' },
|
||||
{ code: 3, value: '审核中' },
|
||||
{ code: 6, value: '审核通过' },
|
||||
],
|
||||
houseStatus: [],
|
||||
houseType: [],
|
||||
houseIndustry: [],
|
||||
},
|
||||
@@ -92,7 +85,7 @@ export default class index extends Component {
|
||||
dataIndex: 'state',
|
||||
sorter: true,
|
||||
width: 100,
|
||||
render: text => this.bindCodeValue(text, 'status'),
|
||||
render: text => this.bindCodeValue(text, 'house_status'),
|
||||
},
|
||||
]
|
||||
|
||||
@@ -146,7 +139,7 @@ export default class index extends Component {
|
||||
componentDidMount() {
|
||||
const { onLoading, onLoadData } = this.table.current
|
||||
onLoading()
|
||||
getDictData('house_type', 'house_industry').then(codes => {
|
||||
getDictData('house_status', 'house_type', 'house_industry').then(codes => {
|
||||
this.setState({ codes: { ...this.state.codes, ...codes } }, () => {
|
||||
onLoadData()
|
||||
})
|
||||
@@ -295,8 +288,8 @@ export default class index extends Component {
|
||||
<Form.Item label="建档状态" name="state">
|
||||
<Select allowClear className="w-150" placeholder="建档状态">
|
||||
<Select.Option value="">全部</Select.Option>
|
||||
{codes.status.map(item => (
|
||||
<Select.Option key={item.code} value={item.code}>
|
||||
{codes.houseStatus.map(item => (
|
||||
<Select.Option key={item.code} value={+item.code}>
|
||||
{item.value}
|
||||
</Select.Option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user