diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs b/Api/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs index 7a97453..096f601 100644 --- a/Api/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs +++ b/Api/Ewide.Application/Service/HouseSafety/HouseQuery/Dto/HouseQueryInput.cs @@ -1,6 +1,7 @@ using Ewide.Core; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,4 +12,10 @@ namespace Ewide.Application { } + + public class HouseQueryDetailInput + { + [Required(ErrorMessage = "Id不能为空")] + public string Id { get; set; } + } } diff --git a/Api/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs b/Api/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs index 453fd84..5800149 100644 --- a/Api/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs +++ b/Api/Ewide.Application/Service/HouseSafety/HouseQuery/HouseQueryService.cs @@ -3,7 +3,9 @@ using Ewide.Core.Extension; using Furion.DatabaseAccessor; using Furion.DependencyInjection; using Furion.DynamicApiController; +using Mapster; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; @@ -77,5 +79,32 @@ WHERE 1=1"; "TotalFloor" }); } + + [HttpGet("/houseQuery/detail")] + public async Task Detail([FromQuery] HouseQueryDetailInput input) + { + var houseCodeOutputAsync = await _dapperRepository.QueryAsync( + @"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(); + houseInfoOutputForDetailPage.HouseInfo = houseInfoOutput; + + return houseInfoOutputForDetailPage; + } } } diff --git a/Api/Ewide.EntityFramework.Core/DbContexts/DefaultDbContext.cs b/Api/Ewide.EntityFramework.Core/DbContexts/DefaultDbContext.cs index 6bdaca5..8dac982 100644 --- a/Api/Ewide.EntityFramework.Core/DbContexts/DefaultDbContext.cs +++ b/Api/Ewide.EntityFramework.Core/DbContexts/DefaultDbContext.cs @@ -168,6 +168,7 @@ namespace Ewide.EntityFramework.Core base.OnModelCreating(modelBuilder); if (App.HostEnvironment.EnvironmentName == "Testing") return; //集成测试下面代码会报错 +#if DEBUG XmlSerializerUtil xmlHandler = new XmlSerializerUtil(); Dictionary dic = xmlHandler.ReaderALL(); foreach (KeyValuePair item in dic) @@ -183,6 +184,7 @@ namespace Ewide.EntityFramework.Core } modelBuilder.Entity(item.Key).HasData(data); } +#endif } } } \ No newline at end of file diff --git a/Api/Ewide.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml b/Api/Ewide.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 0000000..040b013 --- /dev/null +++ b/Api/Ewide.Web.Entry/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,16 @@ + + + + + False + False + True + Release + Any CPU + FileSystem + bin\Release\net5.0\publish\ + FileSystem + + \ No newline at end of file diff --git a/web-react/.env.development b/web-react/.env.development new file mode 100644 index 0000000..b8402ce --- /dev/null +++ b/web-react/.env.development @@ -0,0 +1 @@ +REACT_APP_BASE_URL=http://localhost:5566/ \ No newline at end of file diff --git a/web-react/.env.production b/web-react/.env.production new file mode 100644 index 0000000..a7692b7 --- /dev/null +++ b/web-react/.env.production @@ -0,0 +1 @@ +REACT_APP_BASE_URL=http://118.178.224.202:90/ \ No newline at end of file diff --git a/web-react/public/favicon.ico b/web-react/public/favicon.ico index a11777c..ae7c797 100644 Binary files a/web-react/public/favicon.ico and b/web-react/public/favicon.ico differ diff --git a/web-react/public/index.html b/web-react/public/index.html index b92c542..fb47694 100644 --- a/web-react/public/index.html +++ b/web-react/public/index.html @@ -24,7 +24,7 @@ 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`. --> - React App + 宽易科技 diff --git a/web-react/src/common/api/index.js b/web-react/src/common/api/index.js index c0c329a..e9d7915 100644 --- a/web-react/src/common/api/index.js +++ b/web-react/src/common/api/index.js @@ -17,7 +17,7 @@ import { message as Message, notification } from 'antd' 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 instance = axios diff --git a/web-react/src/common/api/requests/business/houseSafety/houseQuery.js b/web-react/src/common/api/requests/business/houseSafety/houseQuery.js index 6357a36..4749d9d 100644 --- a/web-react/src/common/api/requests/business/houseSafety/houseQuery.js +++ b/web-react/src/common/api/requests/business/houseSafety/houseQuery.js @@ -1,5 +1,6 @@ const urls = { houseQueryPage: ['/houseQuery/page', 'post'], + houseQueryDetail: ['/houseQuery/detail', 'get'], } export default urls \ No newline at end of file diff --git a/web-react/src/components/authority-view/index.jsx b/web-react/src/components/authority-view/index.jsx index 58cf93d..0bac500 100644 --- a/web-react/src/components/authority-view/index.jsx +++ b/web-react/src/components/authority-view/index.jsx @@ -78,28 +78,26 @@ function renderItem(data) { } function renderCheckbox(data) { - return ( + const grid = ( ) + return data.remark ? ( + + {grid} + + ) : ( + grid + ) } export default class AuthorityView extends Component { diff --git a/web-react/src/pages/business/house/query/detail.jsx b/web-react/src/pages/business/house/query/detail.jsx new file mode 100644 index 0000000..60c4d18 --- /dev/null +++ b/web-react/src/pages/business/house/query/detail.jsx @@ -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 ( + + + + + + ) + } +} diff --git a/web-react/src/pages/business/house/query/index.jsx b/web-react/src/pages/business/house/query/index.jsx index 0c03ce9..937dc5b 100644 --- a/web-react/src/pages/business/house/query/index.jsx +++ b/web-react/src/pages/business/house/query/index.jsx @@ -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) => ( + + + this.onOpen(record.id)}>查看 + + + ), + }) + } } /** @@ -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 }, + }) } /** diff --git a/web-react/src/pages/business/house/task/index.jsx b/web-react/src/pages/business/house/task/index.jsx index 635eded..ff9fcb6 100644 --- a/web-react/src/pages/business/house/task/index.jsx +++ b/web-react/src/pages/business/house/task/index.jsx @@ -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 {