Skip to content
Snippets Groups Projects
Commit 279291f7 authored by yms's avatar yms
Browse files

Merge branch 'oldLogin' into city-zw

parents 12152bfa 851d891d
Branches
Tags city_0.1.9
No related merge requests found
...@@ -12,7 +12,7 @@ import { checkBeforeLogin } from './utils/loginUtil/SSO'; ...@@ -12,7 +12,7 @@ import { checkBeforeLogin } from './utils/loginUtil/SSO';
//request 配置 //request 配置
export const request: RequestConfig = { export const request: RequestConfig = {
timeout: 10000, timeout: 30000,
errorConfig, errorConfig,
requestInterceptors, requestInterceptors,
responseInterceptors, responseInterceptors,
......
...@@ -41,7 +41,6 @@ const useRegionalIndex = () => { ...@@ -41,7 +41,6 @@ const useRegionalIndex = () => {
}, },
); );
return { return {
areaListDto, areaListDto,
loading, loading,
......
// import BMapView from '@/components/BMapView';
import CooglMap from '@/components/CooglMap'; import CooglMap from '@/components/CooglMap';
import services from '@/services';
import BMapService from '@/utils/mapService'; import BMapService from '@/utils/mapService';
import { getColorByIndex } from '@/utils/ui'; import { getColorByIndex } from '@/utils/ui';
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import { Space } from 'antd'; import { Space } from 'antd';
import React, { CSSProperties, Fragment, useRef, useState } from 'react'; import React, {
CSSProperties,
Fragment,
useEffect,
useRef,
useState,
} from 'react';
import DistrictDetailBar from '../DIstrictDetailBar'; import DistrictDetailBar from '../DIstrictDetailBar';
import styles from './index.less'; import styles from './index.less';
...@@ -14,9 +20,22 @@ const DistrictMap: React.FC = () => { ...@@ -14,9 +20,22 @@ const DistrictMap: React.FC = () => {
const { selectDistrict, areaListDto } = useModel('regionalIndex'); const { selectDistrict, areaListDto } = useModel('regionalIndex');
const MapRef = useRef<any>(); const MapRef = useRef<any>();
/** 是否启用百度地图 */ /** 是否启用百度地图 */
const [isBmap, setIsBmap] = useState(false); const [isBmap, setIsBmap] = useState(false);
const [data, setData] = useState<any[]>([]);
useEffect(() => {
services.Physicalsign.getObjectPolygon({
physicalSignType: 1,
objectHierarchy: 1,
}).then((res) => {
setData(res.data);
});
}, []);
const [selectedData, setSelectedData] = useState<any>({});
/** /**
* @description 设置地图视野 * @description 设置地图视野
*/ */
...@@ -32,83 +51,15 @@ const DistrictMap: React.FC = () => { ...@@ -32,83 +51,15 @@ const DistrictMap: React.FC = () => {
map.setViewport(points); map.setViewport(points);
} }
}; };
console.log(selectDistrict); console.log(data, selectedData);
useEffect(() => {
const temp = data.find((v) => v?.objectId === selectDistrict?.objectId);
setSelectedData(temp);
}, [data, selectDistrict]);
return ( return (
<div className={styles.container}> <div className={styles.container}>
{/* {isBmap ? (
<BMapView
zoom={13}
ref={MapRef}
style={{ width: '100%', height: '110%' }}
center={new BMapGL.Point(104.066349, 30.658842)}
>
{!selectDistrict ? (
<Fragment>
{areaListDto.map((item, index) => {
return (
<Polygon
fillColor={getColorByIndex(Number(item.qualitySign))}
key={index}
strokeColor="#fff"
fillOpacity={0.3}
strokeWeight={2}
path={BMapService.buildPoints(item.points)}
></Polygon>
);
})}
{areaListDto.map((item, index) => {
const point = BMapService.buildPoint(
Number(item.centerX),
Number(item.centerY),
);
return (
<CustomOverlay position={point}>
<div
className={styles.indexMarker}
style={
BMapService.getMakerCSS(
Number(item.qualitySign),
) as CSSProperties
}
>
{Number(item.qualitySign)}
</div>
</CustomOverlay>
);
})}
</Fragment>
) : (
<>
<Polygon
fillColor={getColorByIndex(Number(selectDistrict?.qualitySign))}
strokeColor="#fff"
fillOpacity={0.3}
strokeWeight={2}
path={BMapService.buildPoints(selectDistrict?.points)}
></Polygon>
<CustomOverlay
position={BMapService.buildPoint(
Number(selectDistrict?.centerX),
Number(selectDistrict?.centerY),
)}
>
<div
className={styles.indexMarker}
style={
BMapService.getMakerCSS(
Number(selectDistrict?.qualitySign),
) as CSSProperties
}
>
{Number(selectDistrict?.qualitySign)}
</div>
</CustomOverlay>
</>
)}
</BMapView>
) : ( */}
<CooglMap.MapView <CooglMap.MapView
zoom={13} zoom={13}
ref={MapRef} ref={MapRef}
...@@ -116,7 +67,8 @@ const DistrictMap: React.FC = () => { ...@@ -116,7 +67,8 @@ const DistrictMap: React.FC = () => {
> >
{!selectDistrict ? ( {!selectDistrict ? (
<Fragment> <Fragment>
{areaListDto.map((item, index) => { {data.map((item, index) => {
console.log(item);
return ( return (
<CooglMap.Polygon <CooglMap.Polygon
fillColor={getColorByIndex(Number(item.qualitySign))!} fillColor={getColorByIndex(Number(item.qualitySign))!}
...@@ -128,7 +80,7 @@ const DistrictMap: React.FC = () => { ...@@ -128,7 +80,7 @@ const DistrictMap: React.FC = () => {
></CooglMap.Polygon> ></CooglMap.Polygon>
); );
})} })}
{areaListDto.map((item, index) => { {data.map((item, index) => {
const point = [Number(item.centerX), Number(item.centerY)]; const point = [Number(item.centerX), Number(item.centerY)];
return ( return (
...@@ -150,42 +102,37 @@ const DistrictMap: React.FC = () => { ...@@ -150,42 +102,37 @@ const DistrictMap: React.FC = () => {
) : ( ) : (
<> <>
<CooglMap.Polygon <CooglMap.Polygon
fillColor={getColorByIndex(Number(selectDistrict?.qualitySign))!} fillColor={getColorByIndex(Number(selectedData?.qualitySign))!}
strokeColor="#fff" strokeColor="#fff"
points={selectDistrict?.points} points={selectedData?.points}
strokeWidth={2} strokeWidth={2}
fillOpacity={0.2} fillOpacity={0.2}
></CooglMap.Polygon> ></CooglMap.Polygon>
<CooglMap.CustomOverlay <CooglMap.CustomOverlay
position={[ position={[
Number(selectDistrict?.centerX), Number(selectedData?.centerX),
Number(selectDistrict?.centerY), Number(selectedData?.centerY),
]} ]}
> >
<div <div
className={styles.indexMarker} className={styles.indexMarker}
style={ style={
BMapService.getMakerCSS( BMapService.getMakerCSS(
Number(selectDistrict?.qualitySign), Number(selectedData?.qualitySign),
) as CSSProperties ) as CSSProperties
} }
> >
{Number(selectDistrict?.qualitySign)} {Number(selectedData?.qualitySign)}
</div> </div>
</CooglMap.CustomOverlay> </CooglMap.CustomOverlay>
</> </>
)} )}
</CooglMap.MapView> </CooglMap.MapView>
{/* )} */}
{selectDistrict && ( {selectDistrict && (
<div className={styles.districtName}>{selectDistrict.objectName}</div> <div className={styles.districtName}>{selectDistrict.objectName}</div>
)} )}
<div className={styles.statusBar}> <div className={styles.statusBar}>
{/* <Space>
<Switch onChange={setIsBmap}></Switch>
<div>启用百度地图</div>
</Space> */}
<Space> <Space>
<div className={styles.mark} style={{ backgroundColor: '#F24F4F' }} /> <div className={styles.mark} style={{ backgroundColor: '#F24F4F' }} />
<div>应急态 &lt;60</div> <div>应急态 &lt;60</div>
......
...@@ -70,12 +70,12 @@ export async function getlistTopNItems( ...@@ -70,12 +70,12 @@ export async function getlistTopNItems(
} }
//中观体征地图边界 //中观体征地图边界
export async function getObjectPolygon(): Promise< export async function getObjectPolygon(
PhysicalsignApi.Result<PhysicalsignApi.ListTopNItems> params: any,
> { ): Promise<PhysicalsignApi.Result<PhysicalsignApi.ListTopNItems>> {
return request( return request(urlProxyApis(`/middlePhysicalSign/getObjectPolygon`), {
urlProxyApis(`/middlePhysicalSign/getObjectPolygon?objectId=1`), params: params,
); });
} }
//中观体征县区体征数据 //中观体征县区体征数据
...@@ -96,12 +96,10 @@ export async function getGroupObjectPhysicalSignIndex(data: { ...@@ -96,12 +96,10 @@ export async function getGroupObjectPhysicalSignIndex(data: {
/** /**
* @description 获取体征指数对比结果接口 * @description 获取体征指数对比结果接口
*/ */
export async function getComparisonIndexInstance( export async function getComparisonIndexInstance(data: any): Promise<any> {
data: any,
): Promise<any> {
return request(urlProxyApis(`/main/getComparisonIndexInstance`), { return request(urlProxyApis(`/main/getComparisonIndexInstance`), {
params: data, params: data,
timeout:30000 timeout: 30000,
}); });
} }
...@@ -162,7 +160,7 @@ export async function getIndexSystem( ...@@ -162,7 +160,7 @@ export async function getIndexSystem(
params: any, params: any,
): Promise<PhysicalsignApi.Result<any>> { ): Promise<PhysicalsignApi.Result<any>> {
return request(urlProxyApis(`/physicalSignIndex/getIndexSystem`), { return request(urlProxyApis(`/physicalSignIndex/getIndexSystem`), {
params params,
}); });
} }
...@@ -206,7 +204,7 @@ export async function getIndexInstanceData( ...@@ -206,7 +204,7 @@ export async function getIndexInstanceData(
): Promise<PhysicalsignApi.Result<any>> { ): Promise<PhysicalsignApi.Result<any>> {
return request(urlProxyApis(`/main/getIndexInstance`), { return request(urlProxyApis(`/main/getIndexInstance`), {
params: data, params: data,
timeout:30000 timeout: 30000,
}); });
} }
...@@ -293,12 +291,10 @@ export async function getCityEventGroupBySource(params: { ...@@ -293,12 +291,10 @@ export async function getCityEventGroupBySource(params: {
} }
//获取所有行业情况 //获取所有行业情况
export async function getAllIndutryIndexInstance( export async function getAllIndutryIndexInstance(params: {
params: { physicalSignType: string;
physicalSignType: string; objectId: string;
objectId: string; }): Promise<PhysicalsignApi.Result<PhysicalsignApi.IndutryIndexInstanceDto>> {
},
): Promise<PhysicalsignApi.Result<PhysicalsignApi.IndutryIndexInstanceDto>> {
return request(urlProxyApis(`/zhgl/getAllIndutryIndexInstance`), { return request(urlProxyApis(`/zhgl/getAllIndutryIndexInstance`), {
method: 'GET', method: 'GET',
params, params,
...@@ -306,12 +302,10 @@ export async function getAllIndutryIndexInstance( ...@@ -306,12 +302,10 @@ export async function getAllIndutryIndexInstance(
} }
//城市运行情况的行业体征 //城市运行情况的行业体征
export async function getCityRunIndutryIndexInstance( export async function getCityRunIndutryIndexInstance(params: {
params: { physicalSignType: string;
physicalSignType: string; objectId: string;
objectId: string; }): Promise<PhysicalsignApi.Result<PhysicalsignApi.IndutryIndexInstanceDto>> {
},
): Promise<PhysicalsignApi.Result<PhysicalsignApi.IndutryIndexInstanceDto>> {
return request(urlProxyApis(`/zhgl/getCityRunIndutryIndexInstance`), { return request(urlProxyApis(`/zhgl/getCityRunIndutryIndexInstance`), {
method: 'GET', method: 'GET',
params, params,
...@@ -320,10 +314,10 @@ export async function getCityRunIndutryIndexInstance( ...@@ -320,10 +314,10 @@ export async function getCityRunIndutryIndexInstance(
//近三十天体征趋势 //近三十天体征趋势
export async function TrendAnalysis( export async function TrendAnalysis(
params: any params: any,
): Promise<PhysicalsignApi.Result<{indexScore:string,date:string}>> { ): Promise<PhysicalsignApi.Result<{ indexScore: string; date: string }>> {
return request(urlProxyApis(`/physicalsignindexinstance/trendAnalysis`), { return request(urlProxyApis(`/physicalsignindexinstance/trendAnalysis`), {
method: 'GET', method: 'GET',
params, params,
}); });
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment