ww664853070 2 years ago
parent
commit
751f5bb858
  1. 25
      weapp/src/packages/patrol/index.jsx
  2. BIN
      web/client/assets/images/gis/pointer.png
  3. 6
      web/client/src/sections/quanju/containers/example.js
  4. 30
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/hudong.js
  5. 2
      web/client/src/sections/quanju/containers/footer/leadership/left/left-center.js
  6. 61
      web/client/src/sections/quanju/containers/public/olMap.js

25
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 = () => {
<AtButton type='primary' className='sub-btn' onClick={report}>上报</AtButton>
}
{
handleType == '已处理' || wait == 'wait' || handle == 'handle' ? <view>
// handleType == '' ||
wait == 'wait' || handle == 'handle' ? <view>
<view className='patrol-img'><text style={{ color: 'red' }}>*</text>处理内容</view>
<AtTextarea
title='处理内容:'

BIN
web/client/assets/images/gis/pointer.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

6
web/client/src/sections/quanju/containers/example.js

@ -24,7 +24,7 @@ const Example = (props) => {
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) => {
</div>
<div style={{ position: 'absolute', width: "100%", height: "90%" }}>
{/* <Gis tabKey={tabKey} /> */}
<OlMap patrolList={patrolList} roadProjectList={roadProjectList} />
<OlMap patrolList={patrolList} roadProjectList={roadProjectList} tab={tabKey} />
<Footer tabKey={tabKey} dispatch={dispatch} />
</div>
</div>

30
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 (
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}>
<div className="contain"
@ -61,15 +61,27 @@ class ReactCarousel extends Component {
onMouseLeave={() => { this.start() }} //鼠标退出自动播放
>
<ul className="ul">
<ul className="ul" style={{ paddingInlineStart: 0 }}>
{
this.state.imgs.map((value, index) => {
return (
<li style={{ position: "relative", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
<li style={{
// position: "relative",
width: "100%", height: "100%",
// top: "-5%",
fontSize: "12px"
}} className={index === this.state.showIndex ? 'show' : ''}
key={index}
>
<div style={{ width: "100%", height: "80%", position: "absolute", top: "10%", right: "5%" }}>
<img src={this.state.dizhi + "/" + value.imgs} style={{ width: "100%", height: "100%", marginLeft: "3%", marginRight: "3%" }} />
<div style={{
width: "100%", height: "80%",
// position: "absolute", top: "10%", right: "5%"
}}>
<img src={this.state.dizhi + "/" + value.imgs} style={{
// width: "100%", height: "100%",
width: 140, height: 140,
marginLeft: "3%", marginRight: "3%"
}} />
</div>
</li>
@ -101,11 +113,11 @@ class ReactCarousel extends Component {
</div >
)
}
componentDidMount() { //一开始自动播放
componentDidMount () { //一开始自动播放
this.start();
}
componentWillUnmount() { //销毁前清除定时器
componentWillUnmount () { //销毁前清除定时器
this.stop();
}
stop = () => { //暂停

2
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]);

61
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,7 +313,13 @@ const OlMap = (props) => {
<div style={{ width: "50%", height: "100%", }}>
{
pointItem.id ?
<Hua shuzu={[{
<Hua key={pointItem.id} shuzu={
isRoadProject ?
[{
"imgs": pointItem.scene_pic && pointItem.scene_pic.length ?
pointItem.scene_pic[0] : ""
}] :
[{
"imgs": pointItem.conserve_after_pic ?
pointItem.conserve_after_pic[0] : ""
}, {
@ -310,7 +328,8 @@ const OlMap = (props) => {
}, {
"imgs": pointItem.conserve_underway_pic ?
pointItem.conserve_underway_pic[0] : ""
}]} />
}]}
/>
: ''
}
</div>

Loading…
Cancel
Save