update 增加了查询分析详情页的文件

This commit is contained in:
2021-07-01 11:02:18 +08:00
parent 653b5b34eb
commit 40d7bef357
14 changed files with 156 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
using Ewide.Core; using Ewide.Core;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -11,4 +12,10 @@ namespace Ewide.Application
{ {
} }
public class HouseQueryDetailInput
{
[Required(ErrorMessage = "Id不能为空")]
public string Id { get; set; }
}
} }

View File

@@ -3,7 +3,9 @@ using Ewide.Core.Extension;
using Furion.DatabaseAccessor; using Furion.DatabaseAccessor;
using Furion.DependencyInjection; using Furion.DependencyInjection;
using Furion.DynamicApiController; using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -77,5 +79,32 @@ WHERE 1=1";
"TotalFloor" "TotalFloor"
}); });
} }
[HttpGet("/houseQuery/detail")]
public async Task<dynamic> Detail([FromQuery] HouseQueryDetailInput input)
{
var houseCodeOutputAsync = await _dapperRepository.QueryAsync<HouseCodeOutput>(
@"SELECT HC.Id,HC.Address,HC.ProjectId,HC.ZoneId,HC.Type,AA.Name AreaName,RA.Name RoadName,CA.Name CommName,O.Name ZoneName,Proj.Note ProjectNote,CONCAT(Proj.Name,'(',Proj.Note,')') ProjectFullName,HC.HouseCode,HC.Lng,HC.Lat,HC.No FROM bs_house_code HC
LEFT JOIN bs_house_projectinfo Proj ON Proj.Id=HC.ProjectId
LEFT JOIN sys_org O ON HC.ZoneId = O.Id
LEFT JOIN sys_area_code CA ON CA.Code = Proj.AreaCode
LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9)
LEFT JOIN sys_area_code AA ON AA.AdCode = SUBSTR(CA.AdCode,1,6)
WHERE HC.Id=@Id", new { input.Id }
);
var houseCodeOutput = houseCodeOutputAsync.SingleOrDefault();
var houseInfoOutputForDetailPage = new HouseInfoOutputForDetailPage
{
HouseCode = houseCodeOutput
};
var houseInfoOutput = (await _houseInfoRep.DetachedEntities.FirstOrDefaultAsync(p => p.HouseCodeId == houseCodeOutput.Id)).Adapt<HouseInfoOutput>();
houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput;
return houseInfoOutputForDetailPage;
}
} }
} }

View File

@@ -168,6 +168,7 @@ namespace Ewide.EntityFramework.Core
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
if (App.HostEnvironment.EnvironmentName == "Testing") return; if (App.HostEnvironment.EnvironmentName == "Testing") return;
//集成测试下面代码会报错 //集成测试下面代码会报错
#if DEBUG
XmlSerializerUtil xmlHandler = new XmlSerializerUtil(); XmlSerializerUtil xmlHandler = new XmlSerializerUtil();
Dictionary<Type, object> dic = xmlHandler.ReaderALL(); Dictionary<Type, object> dic = xmlHandler.ReaderALL();
foreach (KeyValuePair<Type, object> item in dic) foreach (KeyValuePair<Type, object> item in dic)
@@ -183,6 +184,7 @@ namespace Ewide.EntityFramework.Core
} }
modelBuilder.Entity(item.Key).HasData(data); modelBuilder.Entity(item.Key).HasData(data);
} }
#endif
} }
} }
} }

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\net5.0\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1 @@
REACT_APP_BASE_URL=http://localhost:5566/

View File

@@ -0,0 +1 @@
REACT_APP_BASE_URL=http://118.178.224.202:90/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>宽易科技</title>
<script src="https://webapi.amap.com/maps?v=2.0&key=c6a4832b8afbde0361b36630a3fc5bdc&plugin=Map3D,AMap.DistrictSearch,AMap.Geocoder,AMap.AutoComplete,AMap.PlaceSearch"></script> <script src="https://webapi.amap.com/maps?v=2.0&key=c6a4832b8afbde0361b36630a3fc5bdc&plugin=Map3D,AMap.DistrictSearch,AMap.Geocoder,AMap.AutoComplete,AMap.PlaceSearch"></script>
</head> </head>
<body> <body>

View File

@@ -17,7 +17,7 @@ import { message as Message, notification } from 'antd'
const STATUS = status const STATUS = status
axios.defaults.baseURL = '/api' axios.defaults.baseURL = process.env.NODE_ENV === 'development' ? '/api' : process.env.REACT_APP_BASE_URL
const initInstance = (options) => { const initInstance = (options) => {
const instance = axios const instance = axios

View File

@@ -1,5 +1,6 @@
const urls = { const urls = {
houseQueryPage: ['/houseQuery/page', 'post'], houseQueryPage: ['/houseQuery/page', 'post'],
houseQueryDetail: ['/houseQuery/detail', 'get'],
} }
export default urls export default urls

View File

@@ -78,17 +78,9 @@ function renderItem(data) {
} }
function renderCheckbox(data) { function renderCheckbox(data) {
return ( const grid = (
<label className="ant-card-grid ant-card-grid-hoverable"> <label className="ant-card-grid ant-card-grid-hoverable">
<Popover <Checkbox value={data.id} checked={data.checked} onChange={e => this.onChange(e, data)}>
placement="topLeft"
content={data.remark || <span className="text-normal">没有说明</span>}
>
<Checkbox
value={data.id}
checked={data.checked}
onChange={e => this.onChange(e, data)}
>
{data.title} {data.title}
</Checkbox> </Checkbox>
{data.visibleParent && data.type == 2 && ( {data.visibleParent && data.type == 2 && (
@@ -97,9 +89,15 @@ function renderCheckbox(data) {
</Tooltip> </Tooltip>
)} )}
<div className="text-gray">{data.permission}</div> <div className="text-gray">{data.permission}</div>
</Popover>
</label> </label>
) )
return data.remark ? (
<Popover placement="topLeft" content={data.remark}>
{grid}
</Popover>
) : (
grid
)
} }
export default class AuthorityView extends Component { export default class AuthorityView extends Component {

View 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>
)
}
}

View File

@@ -12,7 +12,14 @@ import {
Row, Row,
Tag, Tag,
} from 'antd' } 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 { api } from 'common/api'
import auth from 'components/authorized/handler' import auth from 'components/authorized/handler'
import { first, isEqual, last } from 'lodash' import { first, isEqual, last } from 'lodash'
@@ -46,6 +53,9 @@ const authName = 'houseQuery'
export default class index extends Component { export default class index extends Component {
state = { state = {
codes: { codes: {
houseStatus: [],
houseType: [],
houseIndustry: [],
houseUsedStatus: [], houseUsedStatus: [],
housePropertyRights: [], housePropertyRights: [],
landAttribute: [], landAttribute: [],
@@ -95,10 +105,11 @@ export default class index extends Component {
sorter: true, sorter: true,
}, },
{ {
title: '任务截止时间', title: '建档状态',
dataIndex: 'endTime', dataIndex: 'state',
sorter: true, 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) { constructor(props) {
super(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 const { onLoading, onLoadData } = this.table.current
onLoading() onLoading()
getDictData( getDictData(
'house_status',
'house_type',
'house_industry',
'house_used_status', 'house_used_status',
'house_property_rights', 'house_property_rights',
'land_attribute', 'land_attribute',
@@ -198,8 +227,12 @@ export default class index extends Component {
* @param {*} modal * @param {*} modal
* @param {*} id * @param {*} id
*/ */
onOpen(modal, id) { onOpen(id) {
modal.current.open({ id }) window.openContentWindow({
title: '房屋详情',
path: 'business/house/query/detail',
param: { id },
})
} }
/** /**

View File

@@ -28,14 +28,7 @@ const authName = 'houseTask'
export default class index extends Component { export default class index extends Component {
state = { state = {
codes: { codes: {
status: [ houseStatus: [],
{ code: -1, value: '审核退回' },
{ code: 0, value: '待处理' },
{ code: 1, value: '暂存' },
{ code: 2, value: '待提交' },
{ code: 3, value: '审核中' },
{ code: 6, value: '审核通过' },
],
houseType: [], houseType: [],
houseIndustry: [], houseIndustry: [],
}, },
@@ -92,7 +85,7 @@ export default class index extends Component {
dataIndex: 'state', dataIndex: 'state',
sorter: true, sorter: true,
width: 100, 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() { componentDidMount() {
const { onLoading, onLoadData } = this.table.current const { onLoading, onLoadData } = this.table.current
onLoading() onLoading()
getDictData('house_type', 'house_industry').then(codes => { getDictData('house_status', 'house_type', 'house_industry').then(codes => {
this.setState({ codes: { ...this.state.codes, ...codes } }, () => { this.setState({ codes: { ...this.state.codes, ...codes } }, () => {
onLoadData() onLoadData()
}) })
@@ -295,8 +288,8 @@ export default class index extends Component {
<Form.Item label="建档状态" name="state"> <Form.Item label="建档状态" name="state">
<Select allowClear className="w-150" placeholder="建档状态"> <Select allowClear className="w-150" placeholder="建档状态">
<Select.Option value="">全部</Select.Option> <Select.Option value="">全部</Select.Option>
{codes.status.map(item => ( {codes.houseStatus.map(item => (
<Select.Option key={item.code} value={item.code}> <Select.Option key={item.code} value={+item.code}>
{item.value} {item.value}
</Select.Option> </Select.Option>
))} ))}