wenlele 1 year ago
parent
commit
265d05c377
  1. 1
      api/app/lib/controllers/data/vehicle.js
  2. 2
      api/app/lib/models/report.js
  3. 4
      scripts/1.3.0/schema/6.update_report.sql
  4. 11
      scripts/1.3.1/schema/4.update_report.sql
  5. 83
      weapp/src/packages/patrol/index.jsx
  6. 10
      web/client/src/sections/fillion/components/bridgeTable.js
  7. 7
      web/client/src/sections/fillion/components/highwaysTable.js
  8. 23
      web/client/src/sections/fillion/components/transportationTable.js
  9. 13
      web/client/src/sections/fillion/components/uploads.js
  10. 7
      web/client/src/sections/fillion/containers/luzheng.js
  11. 4
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js
  12. 14
      web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js
  13. 151
      web/client/src/sections/quanju/containers/footer/operation/right.js
  14. 166
      web/client/src/sections/quanju/containers/public/olMap.js

1
api/app/lib/controllers/data/vehicle.js

@ -26,7 +26,6 @@ async function get(ctx) {
}
}
const vehicleRes = await models.Statistic.findAll(findOption)
console.log('vehicleRes', vehicleRes)
ctx.status = 200;
ctx.body = {
vehicleRes: vehicleRes.filter(item => item.dataValues.name === '标志牌' || item.dataValues.name === '养护责任牌')

2
api/app/lib/models/report.js

@ -163,7 +163,7 @@ module.exports = dc => {
handleState: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
defaultValue: '已处理',
comment: null,
primaryKey: false,
field: "handle_state",

4
scripts/1.3.0/schema/6.update_report.sql

@ -1,4 +0,0 @@
alter table report
add handle_opinions varchar(1024);
comment on column report.handle_opinions is '处理意见';

11
scripts/1.3.1/schema/4.update_report.sql

@ -1,6 +1,13 @@
ALTER TABLE "public"."report"
ADD COLUMN "handle_advice" varchar(1024);
ADD COLUMN "handle_advice" varchar(1024)
add handle_opinions varchar(1024);
COMMENT ON COLUMN "public"."report"."handle_state" IS '待处理 / 已指派 / 已处理 / 不处理';
COMMENT ON COLUMN "public"."report"."handle_advice" IS '管理员处理意见';
COMMENT ON COLUMN "public"."report"."handle_advice" IS '管理员处理意见';
comment on column report.handle_opinions is '处理意见';

83
weapp/src/packages/patrol/index.jsx

@ -1443,53 +1443,36 @@ const Index = () => {
{
isSuperAdmin && (wait === 'wait' || kind === 'handle') && <View className='appoint'>
{
handleState === '待处理' ? //
<>
<RadioGroup onChange={(e) => {
setIsAppoint(e.detail.value === '指派' ? true : false)
}}>
<Radio value='指派' checked={isAppoint} color='#0080EE' className='radio'>指派</Radio>
<Radio value='不处理' checked={!isAppoint} color='#0080EE' className='radio' style={{ marginLeft: 10 }}>不处理</Radio>
</RadioGroup>
{
isAppoint && <>
<View className='picker'>
<Text>责任人{appointUser !== null ? userList[appointUser]?.name : ''}</Text>
<Picker
mode='selector'
range={userList}
rangeKey='name'
onChange={e => setAppointUser(Number(e.detail.value))}
>
<Image src={arrowIcon} className='arrow' />
</Picker>
</View>
<Textarea
placeholder='请输入处理意见'
value={handleAdvice}
onInput={e => setHandleAdvice(e.target.value)}
disabled={isView && handleState !== '待处理'}
maxlength={1024}
/>
</>
}
</>
: //
<>
{/* {
handleState === '不处理' && <Text>
处理结果暂不进行处理
</Text>
} */}
{/* {
(handleState === '已指派' || handleState === '已处理') && <>
<View>处理意见</View>
<View>{handleAdvice}</View>
<View style={{ marginTop: 10 }}>责任人</View>
<View>{appointUser !== null ? allDepUsers.find(d => d.depId === userList[appointUser]?.departmentId)?.depName : ''}-{appointUser !== null ? userList[appointUser]?.name : ''}</View>
</>
} */}
</>
handleState === '待处理' && <>
<RadioGroup onChange={(e) => {
setIsAppoint(e.detail.value === '指派' ? true : false)
}}>
<Radio value='指派' checked={isAppoint} color='#0080EE' className='radio'>指派</Radio>
<Radio value='不处理' checked={!isAppoint} color='#0080EE' className='radio' style={{ marginLeft: 10 }}>不处理</Radio>
</RadioGroup>
{
isAppoint && <>
<View className='picker'>
<Text>责任人{appointUser !== null ? userList[appointUser]?.name : ''}</Text>
<Picker
mode='selector'
range={userList}
rangeKey='name'
onChange={e => setAppointUser(Number(e.detail.value))}
>
<Image src={arrowIcon} className='arrow' />
</Picker>
</View>
<Textarea
placeholder='请输入处理意见'
value={handleAdvice}
onInput={e => setHandleAdvice(e.target.value)}
disabled={isView && handleState !== '待处理'}
maxlength={1024}
/>
</>
}
</>
}
</View>
}
@ -1510,7 +1493,11 @@ const Index = () => {
{
(isSuperAdmin && (handleState === '已指派' || handleState === '已处理')) && <>
<View style={{ marginTop: 10 }}>责任人</View>
<View>{appointUser !== null ? allDepUsers.find(d => d.depId === userList[appointUser]?.departmentId)?.depName : ''}-{appointUser !== null ? userList[appointUser]?.name : ''}</View>
<View>
{appointUser !== null ? allDepUsers.find(d => d.depId === userList.find(u => u.id === appointUser)?.departmentId)?.depName : ''}
-
{appointUser !== null ? userList.find(u => u.id === appointUser)?.name : ''}
</View>
</>
}
</View>

10
web/client/src/sections/fillion/components/bridgeTable.js

@ -39,6 +39,12 @@ const BrideTable = (props) => {
setDelet(res)
})
}
useEffect(async () => {
const res = await dispatch(getBridge())
setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥'))
setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥'))
setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥'))
}, [])
const deldatas = (id) => { // 工程
const query = {
projectId: id
@ -1813,9 +1819,7 @@ const BrideTable = (props) => {
setRowSelected([]);
const res = await dispatch(getBridge(query));
// console.log(res)
setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥'))
setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥'))
setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥'))
setCounts(res.payload.data)
return {
...res,

7
web/client/src/sections/fillion/components/highwaysTable.js

@ -91,15 +91,14 @@ const TransporTationTable = (props) => {
width: 160,
fixed: 'right',
render: (dom, record) => {
console.log('record', record.id === null)
return <div><Button type="link"
return <div>{record.id !== null ? (<Button type="link"
onClick={() => {
hightModal('edit', record)
setTypecard('compile')
setRecortd(record)
}}
disabled={editAble && record.id === null}
>编辑</Button></div>
disabled={editAble}
>编辑</Button>) : null}</div>
}
},

23
web/client/src/sections/fillion/components/transportationTable.js

@ -76,6 +76,20 @@ const TransporTationTable = (props) => {
setDelet(res)
})
}
useEffect(async () => {
console.log('whichofits', whichofits)
let query = {}
if (whichofits === '县') {
query.level = '县'
} else if (whichofits === '乡') {
query.level = '乡'
} else if (whichofits === '村') {
query.level = '村'
}
const res = await dispatch(getRoadway(query))
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
}, [whichofits])
const columns = {
tab1: [
{
@ -3823,8 +3837,7 @@ const TransporTationTable = (props) => {
}
setRowSelected([]);
const res = await dispatch(getRoadway(query));
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data)
@ -3840,8 +3853,6 @@ const TransporTationTable = (props) => {
}
setRowSelected([]);
const res = await dispatch(getRoadway(query));
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data)
@ -3856,8 +3867,6 @@ const TransporTationTable = (props) => {
}
setRowSelected([]);
const res = await dispatch(getRoadway(query))
const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))];
setRoadData(uniqueArray)
setCounts(departmentInfo ? res.payload.data.filter((item) => {
return item.townshipCode === departmentInfo.areaCode
}) : res.payload.data)
@ -3883,7 +3892,7 @@ const TransporTationTable = (props) => {
search={{
defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [
<span style={{ marginRight: 20 }}>{`共有${whichofits}道:${roadData.length || 0}`}</span>,
<span >{`共有${whichofits}道:${roadData.length || 0}`}</span>,
...dom.reverse(),
<Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, grade, differentiate) }}
disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''}

13
web/client/src/sections/fillion/components/uploads.js

@ -18,9 +18,8 @@ class Uploads extends Component {
removeFilesList: []
};
}
dealName = (uploaded) => {
console.log(uploaded)
let realName = uploaded.split('/')[2]
let x1 = realName.split('.')
let x2 = x1[0].split('_')
@ -31,6 +30,7 @@ class Uploads extends Component {
setFileList = (value) => {
let defaultFileList = [];
defaultFileList = value.map((u, index) => {
// let fileUrl = `${this.ApiRoot}/${u.url}`;
let fileUrl = `${u.url}`;
return {
uid: -index - 1,
@ -56,11 +56,13 @@ class Uploads extends Component {
componentWillReceiveProps (np) {
const { dispatch, value: thisEditData, onChange } = this.props;
const { value: nextEditData, clearFileList } = np;
console.log(nextEditData,'哈哈哈哈')
const setFileList = () => {
let defaultFileList = [];
defaultFileList = nextEditData.map((u, index) => {
let fileUrl = `${this.ApiRoot}/${u.storageUrl}`;
// let fileUrl = `${this.ApiRoot}/${u.storageUrl}`;
let fileUrl = `${u.url}`;
return {
uid: -index - 1,
name: this.dealName(u.storageUrl),
@ -74,7 +76,6 @@ class Uploads extends Component {
fileList: defaultFileList
});
};
if (nextEditData && nextEditData.length) {
if (!thisEditData || !this.state.fileList.length) {
setFileList();
@ -268,7 +269,7 @@ class Uploads extends Component {
// }
// return f
// })
console.log('fileList_:', fileList_);
return (
<div>
<Spin spinning={delPicIng}>

7
web/client/src/sections/fillion/containers/luzheng.js

@ -51,7 +51,8 @@ function Assess(props) {
const getData = () => {
setLoading(true)
dispatch(getRoadadministration(query)).then(res => {
console.log(query,'query')
dispatch(getRoadadministration({...query})).then(res => {
if(res?.success){
setdatasource(res?.payload?.data?.rows)
settotal(res?.payload?.data?.count)
@ -147,7 +148,8 @@ function Assess(props) {
dispatch(delRoadadministration(record.id)).then(res => {
setLoading(false)
if (res.success) {
getData()
setQuery({...query, page: 1, pageSize: 10, limit: 10})
// getData(page)
}
})
}}
@ -165,6 +167,7 @@ function Assess(props) {
defaultPageSize: 10,
showSizeChanger: false,
onChange: (page, pageSize) => {
console.log(page,'page')
setQuery({
...query,
page, limit: pageSize

4
web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js

@ -38,6 +38,7 @@ const Right = (props) => {
// const
})
}, [])
const roadMile = 2481.2
const renderBody = () => {
return (
@ -117,8 +118,7 @@ const Right = (props) => {
</div>
<div style={{ width: "96%", position: "relative", left: "2%" }}>
{/* <Spin spinning={!roads} tip="Loading" > */}
<p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}></span>2481.2<span style={{ marginLeft: "4%" }}></span></p>
<p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}>{roadMile}</span><span style={{ marginLeft: "4%" }}></span></p>
{/* <p style={{ width: "50%", position: "absolute", color: "rgba(216,240,255,0.8)", fontSize: "18px" }}>乡村道道路<span style={{ marginLeft: "4%", fontFamily: "YouSheBiaoTiHei", fontSize: "24px", color: "#F5FCFF" }}>{isNaN((roads?.["乡"] + roads?.["村"]).toFixed(3)) ? "" : (roads?.["乡"] + roads?.["村"]).toFixed(3)}</span><span style={{ marginLeft: "4%" }}>公里</span></p> */}
<p style={{ position: "absolute", right: "0", color: "rgba(216,240,255,0.8)", top: "10px" }}>占比<span>{((2481.2 / 2689) * 100).toFixed(2)}</span><span>%</span></p>

14
web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js

@ -28,7 +28,7 @@ const Leftcenter = (props) => {
{/* <div className={tabKey == "build" ? "tabKey-map" : "notabKey"} style={{ backgroundImage: "url(/assets/images/quanju/zuobeijing.png)", backgroundSize: "100% 100%" }} onClick={() => {
onClick("build")
}}><a>建设</a></div> */}
<div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "2%", top: "100%" }} onClick={() => {
<div style={{ width: "35%", height: "10vh", backgroundColor: "", position: "relative", left: "10%", top: "100%" }} onClick={() => {
onClick("daolu")
}} >
{
@ -37,14 +37,14 @@ const Leftcenter = (props) => {
<div style={{ width: "50%", height: "100%", position: "absolute", left: "17%", top: "23%" }}>
<img src='/assets/images/leadership/lu.png' style={{ width: "50%" }} />
</div>
<div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "11%" }}>
<div style={{ width: "60%", height: "100%", position: "absolute", left: "50%", top: "11%" }}>
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>2689</p>
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>道路统计<span style={{ marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}>公里</span></p>
{/* <p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)) ? "" : (list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)}</p> */}
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#ffffff", fontSize: "2.5vh", marginTop: "-2%" }}>2689</p>
</div>
</div>
<div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "35%", top: "-105%" }} onClick={() => {
{/* <div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "35%", top: "-105%" }} onClick={() => {
onClick("handong")
}} >
{
@ -57,8 +57,8 @@ const Leftcenter = (props) => {
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>涵洞统计<span style={{ fontSize: "14px", marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}></span></p>
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#24FFEE", fontSize: "2.5vh" }}>{isNaN((culvert?.["县"] + culvert?.["乡"] + culvert?.["村"]).toFixed(0)) ? "" : (culvert?.["县"] + culvert?.["乡"] + culvert?.["村"]).toFixed(0)}</p>
</div>
</div>
<div style={{ width: "30%", height: "10vh", backgroundColor: "", position: "relative", left: "68%", top: "-315%" }} onClick={() => {
</div> */}
<div style={{ width: "35%", height: "10vh", backgroundColor: "", position: "relative", left: "55%", top: "-100%" }} onClick={() => {
onClick("qiaoliang")
}} >
{
@ -68,8 +68,8 @@ const Leftcenter = (props) => {
<img src='/assets/images/leadership/qiao.png' style={{ width: "50%" }} />
</div>
<div style={{ width: "50%", height: "100%", position: "absolute", left: "50%", top: "8%" }}>
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>桥梁统计<span style={{ fontSize: "14px", marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}></span></p>
<p style={{ fontFamily: "YouSheBiaoTiHei", color: "#00F1FF", fontSize: "2.5vh", marginTop: "-2%" }}>165</p>
<p style={{ fontSize: "2vh", color: "#D8F0FF", fontFamily: "PingFangSC-Regular, PingFang SC", marginTop: "3%" }}>桥梁统计<span style={{ marginLeft: "10px", color: "rgba(216,240,255,0.8000)" }}></span></p>
{/* <p style={{ fontFamily: "YouSheBiaoTiHei", color: "#00F1FF", fontSize: "2.5vh", marginTop: "-2%" }}>{isNaN((bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])) ? "" : (bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])}</p> */}
</div>

151
web/client/src/sections/quanju/containers/footer/operation/right.js

@ -30,16 +30,55 @@ const Right = ({ busRunTime }) => {
const [queryStr, setQueryStr] = useState('')
useEffect(() => {
setBusRunTimeList(
queryStr ?
busRunTime.filter(b => {
return b?.busNoChar?.indexOf(queryStr) > -1
})
: busRunTime
)
let repeatCarNo = []
let nextBusRunList = queryStr ?
busRunTime.filter(b => {
let queryMatch = b?.busNoChar?.indexOf(queryStr) > -1
if (repeatCarNo.some(c => c == b.busNoChar.trim())) {
return false
} else {
repeatCarNo.push(b.busNoChar.trim())
return queryMatch && true
}
})
: busRunTime.filter(b => {
if (repeatCarNo.some(c => c == b.busNoChar.trim())) {
return false
} else {
repeatCarNo.push(b.busNoChar.trim())
return true
}
})
console.log(nextBusRunList);
setBusRunTimeList(nextBusRunList)
}, [queryStr, busRunTime])
const style = { height: "97%", marginTop: "3%" }
const carouselContent = busRunTimeList.map((d, index) => {
return (
<div key={index} style={{ width: '100%', height: '40%' }}>
<div className='busInformation'>
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} />
<span>
<h3>车辆牌照</h3>
<h5>{d.busNoChar}</h5>
<h3>调度状态</h3>
<h4>{busWillRun.find(w => w.value == d.willRun)?.text || '--'}</h4>
</span>
<span>
<h3>发车时间</h3>
<h5>{d.lastDepTime}</h5>
</span>
<span style={{ position: 'relative', left: '21%' }}>
<h3>司机</h3>
<h5>{d.employeeName}</h5>
<h3>工号</h3>
<h4>{d.opNo}</h4>
</span>
</div>
</div>
)
})
return (
<div style={{ position: 'absolute', right: 0, width: "23%", height: "100%", marginRight: "1%", }}>
<Module style={style} customize={true}
@ -70,71 +109,53 @@ const Right = ({ busRunTime }) => {
/>
</div>
<Carousel
autoplay
infinite
// autoplaySpeed={300000}
autoplaySpeed={1000 * 3}
vertical={true}
slidesToShow={4}
>
{
busRunTimeList.map((d, index) => {
return (
{
carouselContent.length > 3 ?
<Carousel
autoplay
infinite
// autoplaySpeed={300000}
autoplaySpeed={1000 * 3}
vertical={true}
slidesToShow={4}
>
{
carouselContent
}
{/* {
dataLists.map((data, index) => (
<div key={index} style={{ width: '100%', height: '40%' }}>
<div className='busInformation'>
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} />
<span>
<h3>车辆牌照</h3>
<h5>{d.busNoChar}</h5>
<h3>调度状态</h3>
<h4>{busWillRun.find(w => w.value == d.willRun)?.text || '--'}</h4>
</span>
<span>
<h3>发车时间</h3>
<h5>{d.lastDepTime}</h5>
</span>
<span style={{ position: 'relative', left: '21%' }}>
<h3>司机</h3>
<h5>{d.employeeName}</h5>
<h3>工号</h3>
<h4>{d.opNo}</h4>
<h3>所属线路</h3>
<h4>{data.route}</h4>
<h3>车辆牌照号</h3>
<h5>{data.plate}</h5>
</span>
</div>
<div className='busVideo'>
<div style={{
width: '98%', margin: '1% 1%', height: 152, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj1.png' style={{ width: '100%', height: '100%' }} /></div>
<div style={{
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj2.png' style={{ width: '100%', height: '100%' }} /></div>
<div style={{
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj3.png' style={{ width: '100%', height: '100%' }} /></div>
</div>
</div>
)
})
}
{/* {
dataLists.map((data, index) => (
<div key={index} style={{ width: '100%', height: '40%' }}>
<div className='busInformation'>
<img src='/assets/images/quanju/theBus.png' style={{ width: '15%', display: 'block', float: 'left' }} />
<span>
<h3>所属线路</h3>
<h4>{data.route}</h4>
<h3>车辆牌照号</h3>
<h5>{data.plate}</h5>
</span>
</div>
<div className='busVideo'>
<div style={{
width: '98%', margin: '1% 1%', height: 152, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj1.png' style={{ width: '100%', height: '100%' }} /></div>
<div style={{
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj2.png' style={{ width: '100%', height: '100%' }} /></div>
<div style={{
width: '48%', margin: '1% 1%', height: 100, display: 'block', float: 'left', boxShadow: '0px 1px 5px 0px #1C60FE',
border: '1px solid #1C60FE'
}}><img src='/assets/images/quanju/fake/gj3.png' style={{ width: '100%', height: '100%' }} /></div>
</div>
</div>
))
} */}
</Carousel>
))
} */}
</Carousel>
:
carouselContent
}
</div>
</Module>
</div>

166
web/client/src/sections/quanju/containers/public/olMap.js

@ -4,6 +4,7 @@ import request from 'superagent'
import Hua from '../footer/leadership/centerleft/hudong'
import moment from 'moment';
import { OlMapRequest } from '$utils'
import { useRef } from 'react';
export const busWillRun = [
{ text: '非运营', value: '0' },
@ -17,16 +18,25 @@ export const busWillRun = [
{ text: '检车', value: '8' },
]
const codeMap = {
x: 'gpsxd',
y: 'gpsyd',
c: 'gpscd',
}
const OlMap = (props) => {
const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab, busRunTime, busLine } = props
const { dispatch, actions, user, olMapArcgisHost, olMapGeoDataHost, patrolList, roadProjectList, tab, busRunTime, busLine, projectList } = props
const [olMapOpenData, setOlMapOpenData] = useState([])
const [olMap, setOlMap] = useState()
const [curClickCoordinate, setCurClickCoordinate] = useState([])
const [pointItem, setPointItem] = useState({})
//
const [busRunData, setBusRunData] = useState([])
//
const curTab = useRef(tab)
useEffect(() => {
curTab.current = tab
setOlMapOpenData([])
setPointItem({})
if (olMap) {
@ -79,6 +89,10 @@ const OlMap = (props) => {
olMapTool.closeOverlay('pointClickOpen')
olMapTool.removeGeometryLayer('geometry0')
setCurClickCoordinate(p.coordinate)
if (curTab.current == 'build') {
return
}
// 请求路线坐标
request.post(`${olMapGeoDataHost || 'http://36.2.6.32:8811'}/geoserver-pg/rest/bufferSearch`)
.type('form')
@ -201,11 +215,6 @@ const OlMap = (props) => {
})
// 请求路线坐标
if (d.code_road) {
let codeMap = {
x: 'gpsxd',
y: 'gpsyd',
c: 'gpscd',
}
let roadCodeStart = d.code_road[0]
let layerName = codeMap[roadCodeStart.toLowerCase()]
if (layerName) {
@ -425,34 +434,35 @@ const OlMap = (props) => {
useEffect(() => {
if (busLine && olMap && tab == 'operation') {
olMap.addGeometryLayer({
features: [
{
name: 'busLine',
attributes: {
},
geometry: busLine.map(b => {
return [b.pointLng, b.pointLat]
}),
// geometry: [115.944220000000, 28.545380000000],
geometryType: 'LineString',
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
},
],
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry_bus_line'
});
if (busLine.length) {
olMap.closeOverlay('clickOpen')
busRunData.forEach((d, index) => {
olMap.removeGeometryLayer('geometry_bus_' + index)
})
olMap.addGeometryLayer({
features: [
{
name: 'busLine',
attributes: {
},
geometry: busLine.map(b => {
return [b.pointLng, b.pointLat]
}),
// geometry: [115.944220000000, 28.545380000000],
geometryType: 'LineString',
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
},
],
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry_bus_line'
});
olMap.setCenter([
(busLine[0].pointLng + busLine[busLine.length - 1].pointLng) / 2,
(busLine[0].pointLat + busLine[busLine.length - 1].pointLat) / 2
])
busRunData.forEach((d, index) => {
olMap.removeGeometryLayer('geometry_bus_' + index)
})
} else {
drawBusRunPoint()
}
@ -461,6 +471,103 @@ const OlMap = (props) => {
}
}, [busLine, olMap, tab])
useEffect(async () => {
if (olMap) {
if (tab == 'build') {
const roadRes = await Promise.all(projectList.map((d, index) => {
let roadCodeStart = d.roadCodeStart ? d.roadCodeStart[0] : 'N'
let layerName = codeMap[roadCodeStart.toLowerCase()]
if (layerName) {
return request.post(`${olMapGeoDataHost || 'http://36.2.6.32:8811'}/geoserver-pg/rest/search`)
.type('form')
.send({
params: `{"layerName":"${layerName}","filter":"(roadcode = '${d.roadCodeStart}')","spatialFilter":"","isReturnGeometry":"true","orderByFields":"roadcode, roadstart asc","spatialRel":"INTERSECTS","pageNum":1,"pageSize":99}`
})
} else {
return new Promise(resolve => setTimeout(() => resolve(), 0));
}
}))
let renderIndex = 0
for (let res of roadRes) {
if (res) {
if (res.status == 200 && res.body && res.body.code == 1) {
const data = res.body.data
const { datalist } = data
if (datalist?.list?.length) {
let dataIndex = 0
for (let d of datalist.list) {
const corData = projectList[renderIndex]
olMap.addGeometryJMLayer({
features: [
{
geometry: d.shape,
geometryType: 'LineString',
// geometryType: 'Point',
attributes: {
callbackParams: {},
callback: (p, x) => {
let extent = p?.selected[0]?.values_?.geometry?.flatCoordinates
let coordinate = []
if (extent && extent.length) {
let coordinateIndex = Math.ceil((extent.length - 1) / 2)
if (coordinateIndex % 2) {
coordinateIndex -= 1
}
coordinate = [extent[coordinateIndex], extent[coordinate + 1]]
}
if (coordinate.length) {
setOlMapOpenData([{
n: '项目名称',
v: corData.entryName
}, {
n: '项目规模(公里)',
v: corData.projectMileage
}, {
n: '项目投资(万元)',
v: corData.investment
}, {
n: '业主单位',
v: corData.buildUnit,
}, {
n: '施工单位',
v: corData.constructionUnit
}, {
n: '开工日期',
v: corData.startTime ? moment(corData.startTime).format('YYYY-MM-DD') : ''
},])
olMap.addOverlay('clickOpen', {
id: 'clickOpen',
offset: [0, 4], // 偏移
position: coordinate, // 坐标
// position: [115.944220000000, 28.545380000000],
autoPan: true,
autoPanMargin: 100,
positioning: 'top-right'
})
}
}
},
},
],
style: { stroke: { width: 5, color: '#9933FF' } },
selectStyle: { stroke: { width: 8, color: '#9933FF' } },
layerName: 'geometry_build_road_' + renderIndex
});
}
}
}
}
renderIndex++
}
} else {
projectList.forEach((d, index) => {
olMap.removeGeometryLayer('geometry_build_road_' + index)
})
}
}
}, [projectList, olMap, tab])
const isRoadProject = pointItem.report_type == 'road'
// const isBusPoint = pointItem.busNoChar
return (
@ -624,7 +731,7 @@ const OlMap = (props) => {
}
function mapStateToProps (state) {
const { auth, global, busRunTime, busLine } = state;
const { auth, global, busRunTime, busLine, projectList } = state;
return {
user: auth.user,
actions: global.actions,
@ -632,6 +739,7 @@ function mapStateToProps (state) {
olMapGeoDataHost: global.olMapGeoDataHost,
busRunTime: busRunTime.data || [],
busLine: busLine.data || [],
projectList: projectList.data || []
};
}

Loading…
Cancel
Save