diff --git a/weapp/src/packages/patrol/index.jsx b/weapp/src/packages/patrol/index.jsx index 7adbd1fd..e9b98ef4 100644 --- a/weapp/src/packages/patrol/index.jsx +++ b/weapp/src/packages/patrol/index.jsx @@ -255,7 +255,7 @@ const Index = () => { ]) }, [reportType]) - function report() { + function report () { if (!canReport) { return } if ( (isPatrol && (!projectType || !road)) @@ -332,7 +332,7 @@ const Index = () => { }) } - function deleteReport() { + function deleteReport () { Taro.showModal({ title: '提示', content: '确定删除吗?', @@ -359,7 +359,7 @@ const Index = () => { }) } - function handleInput({ detail: { value } }, type) { + function handleInput ({ detail: { value } }, type) { switch (type) { case 'roadSectionStart': setRoadSectionStart(value) @@ -394,15 +394,15 @@ const Index = () => { } } - function handleTypeChange(e) { + function handleTypeChange (e) { setReportType(e.detail.value) } - function handleImgChange(files, operationType, index, type) { + function handleImgChange (files, operationType, index, type) { if (operationType === 'remove') { setImg(false) } - function setImg(isAdd, url) { + function setImg (isAdd, url) { switch (type) { case 'scenePic': let nextImg = sceneImg @@ -502,12 +502,12 @@ const Index = () => { } } - function handleImgClick(index, file) { + function handleImgClick (index, file) { Taro.previewImage({ urls: [file.url] // 需要预览的图片http链接列表 }) } - function handleImgClicks(index, file) { + function handleImgClicks (index, file) { Taro.previewImage({ urls: [file] // 需要预览的图片http链接列表 }) @@ -529,7 +529,7 @@ const Index = () => { } } }, [road]) - function handleOk() { + function handleOk () { if (!canReport) { return } let str = handleCenter.trim() if (!str) { @@ -574,14 +574,14 @@ const Index = () => { } }) } - function addVideo() { + function addVideo () { wx.chooseMedia({ count: 1, mediaType: ['video'], sourceType: ['album', 'camera'], maxDuration: 15, camera: 'back', - success(res) { + success (res) { const tempFilePaths = res.tempFiles[0].tempFilePath let token = getState('token') || Taro.getStorageSync('token') if (res.tempFiles[0].duration < 15) { @@ -947,7 +947,8 @@ const Index = () => { 上报 } { - handleType == '已处理' || wait == 'wait' || handle == 'handle' ? + // handleType == '已处理' || + wait == 'wait' || handle == 'handle' ? *处理内容: { console.log(tab); if (tab === 'conserve') { dispatch(getReportList({ - reportType: 'patrol', + reportType: 'conserve', isTop: true })).then(res => { console.log(res); @@ -32,6 +32,8 @@ const Example = (props) => { setPatrolList(res.payload.data || []) } }) + } + if (tab === 'build') { dispatch(getReportList({ reportType: 'road', isTop: true @@ -56,7 +58,7 @@ const Example = (props) => {
{/* */} - +
diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js index 41ec44a9..4d01525f 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js @@ -2,7 +2,7 @@ import { values } from 'lodash'; import React, { Component } from 'react'; import './conter.less'; class ReactCarousel extends Component { - chunk(arr, size) { + chunk (arr, size) { var arr1 = new Array(); for (var i = 0; i < Math.ceil(arr.length / size); i++) { arr1[i] = new Array(); @@ -45,7 +45,7 @@ class ReactCarousel extends Component { // arr1: "" dizhi: localStorage.getItem("qndmn") } - // console.log(this.state.imgs); + console.log(this.props.shuzu); this.state.imgs = this.props.shuzu.filter((item) => { return item.imgs !== "" }) @@ -53,7 +53,7 @@ class ReactCarousel extends Component { } - render() { + render () { return (
{ this.start() }} //鼠标退出自动播放 > -
    +
      { this.state.imgs.map((value, index) => { return ( -
    • -
      - +
      +
    • @@ -101,11 +113,11 @@ class ReactCarousel extends Component {
) } - componentDidMount() { //一开始自动播放 + componentDidMount () { //一开始自动播放 this.start(); } - componentWillUnmount() { //销毁前清除定时器 + componentWillUnmount () { //销毁前清除定时器 this.stop(); } stop = () => { //暂停 diff --git a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js index 36aeabe6..7587bf57 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js @@ -36,7 +36,7 @@ const Leftcenter = ({ videoCenterList }) => { setNum(num + 1); // setTu(list[num].img); } - }, 2000 * 10); + }, 1000 * 60 * 5); return () => clearInterval(timer); }, [num]); diff --git a/web/client/src/sections/quanju/containers/public/olMap.js b/web/client/src/sections/quanju/containers/public/olMap.js index 816ac777..85e7d53c 100644 --- a/web/client/src/sections/quanju/containers/public/olMap.js +++ b/web/client/src/sections/quanju/containers/public/olMap.js @@ -6,14 +6,20 @@ import moment from 'moment'; import { OlMapRequest } from '$utils' const OlMap = (props) => { - const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList } = props + const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab } = props const [olMapOpenData, setOlMapOpenData] = useState([]) const [olMap, setOlMap] = useState() const [pointItem, setPointItem] = useState({}) useEffect(() => { - - }, []) + setOlMapOpenData([]) + setPointItem({}) + if (olMap) { + olMap.closeOverlay('clickOpen') + olMap.closeOverlay('pointClickOpen') + olMap.removeGeometryLayer('geometry0') + } + }, [tab]) useEffect(() => { if (olMapGeoDataHost) { @@ -148,7 +154,11 @@ const OlMap = (props) => { }, [olMapGeoDataHost]) useEffect(() => { - if (patrolList.length && olMap) { + if (patrolList.length && olMap && tab == 'conserve') { + roadProjectList.forEach((d, index) => { + olMap.removeGeometryLayer('geometry_road_' + index) + }) + patrolList.forEach((d, index) => { console.log(d, index); olMap.addGeometryLayer({ @@ -164,7 +174,7 @@ const OlMap = (props) => { setPointItem(d) olMap.addOverlay('pointClickOpen', { id: 'pointClickOpen', - offset: [0, 25], // 偏移 + offset: [0, 4], // 偏移 position: [d.longitude, d.latitude], // 坐标 autoPan: true, autoPanMargin: 100, @@ -178,9 +188,8 @@ const OlMap = (props) => { ], style: { icon: { - src: '/assets/images/worker.png', - // anchor: [0.5, 1], - scale: 0.08, // 图标引用 + src: '/assets/images/gis/pointer.png', + scale: 1, // 图标引用 }, // stroke: { width: 1, color: '#ffff00' }, // circle: { @@ -191,9 +200,8 @@ const OlMap = (props) => { }, selectStyle: { icon: { - src: '/assets/images/worker.png', - // anchor: [0.5, 1], - scale: 0.08, // 图标引用 + src: '/assets/images/gis/pointer.png', + scale: 1, // 图标引用 }, // circle: { // radius: 16, // 直径 @@ -206,10 +214,14 @@ const OlMap = (props) => { }); }); } - }, [patrolList, olMap]) + }, [patrolList, olMap, tab]) useEffect(() => { - if (roadProjectList.length && olMap) { + if (roadProjectList.length && olMap && tab == 'build') { + patrolList.forEach((d, index) => { + olMap.removeGeometryLayer('geometry_patrol_' + index) + }) + roadProjectList.forEach((d, index) => { olMap.addGeometryLayer({ features: [ @@ -224,7 +236,7 @@ const OlMap = (props) => { setPointItem(d) olMap.addOverlay('pointClickOpen', { id: 'pointClickOpen', - offset: [0, 25], // 偏移 + offset: [0, 4], // 偏移 position: [d.longitude, d.latitude], // 坐标 // position: [115.944220000000, 28.545380000000], autoPan: true, @@ -240,21 +252,21 @@ const OlMap = (props) => { ], style: { icon: { - src: '/assets/images/worker.png', - scale: 0.08, // 图标引用 + src: '/assets/images/gis/pointer.png', + scale: 1, // 图标引用 }, }, selectStyle: { icon: { - src: '/assets/images/worker.png', - scale: 0.08, // 图标引用 + src: '/assets/images/gis/pointer.png', + scale: 1, // 图标引用 }, }, layerName: 'geometry_road_' + index }); }); } - }, [roadProjectList, olMap]) + }, [roadProjectList, olMap, tab]) const isRoadProject = pointItem.report_type == 'road' return ( @@ -301,16 +313,23 @@ const OlMap = (props) => {
{ pointItem.id ? - + : '' }