yangsen 3 years ago
parent
commit
8d7f16db1c
  1. 4
      api/.vscode/launch.json
  2. 25
      api/app/lib/controllers/data/overspeed.js
  3. 3
      weapp/src/app.config.js
  4. 7
      weapp/src/config.js
  5. 3
      weapp/src/packages/video/index.config.js
  6. 85
      weapp/src/packages/video/index.jsx
  7. 28
      weapp/src/packages/video/index.scss
  8. 4
      weapp/src/pages/home/index.jsx
  9. 4
      web/Dockerfile
  10. 2
      web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js

4
api/.vscode/launch.json

@ -13,8 +13,8 @@
"NODE_ENV": "development"
},
"args": [
"-p 4000",
"-f http://localhost:4000",
"-p 14000",
"-f http://localhost:14000",
"-g postgres://postgres:123@10.8.30.32:5432/highways4good",
"--qnak XuDgkao6cL0HidoMAPnA5OB10Mc_Ew08mpIfRJK5",
"--qnsk yewcieZLzKZuDfig0wLZ9if9jKp2P_1jd3CMJPSa",

25
api/app/lib/controllers/data/overspeed.js

@ -34,16 +34,27 @@ async function overspeedGet (ctx) {
if (numberOfAxles) {
findOption.where.numberOfAxles = numberOfAxles
}
if (overrunRateUpper) {
findOption.where.overrunRate = {
$lte: overrunRateUpper
if (overrunRateUpper && overrunRateFloor) {
findOption.where['$and'] = []
findOption.where['$and'].push
({ overrunRate: { $lte: overrunRateUpper } })
findOption.where['$and'].push
({ overrunRate: { $gte: overrunRateFloor } })
} else {
if (overrunRateUpper) {
findOption.where.overrunRate = {
$lte: overrunRateUpper
}
}
}
if (overrunRateFloor) {
findOption.where.overrunRate = {
$gte: overrunRateFloor
if (overrunRateFloor) {
findOption.where.overrunRate = {
$gte: overrunRateFloor
}
}
}
if (testTime) {
findOption.where.testTime = {
$between: [moment(testTime).startOf('day').format(), moment(testTime).endOf('day').format()]

3
weapp/src/app.config.js

@ -10,7 +10,8 @@ export default {
'patrol/index',
'patrolView/index',
'changePassword/index',
'changePassword/success/index'
'changePassword/success/index',
'video/index',
]
}],
permission: {

7
weapp/src/config.js

@ -8,9 +8,10 @@ const baseConfig = {
};
const development = {
baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io',
webUrl: 'https://smartwater.anxinyun.cn',
pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c',
baseUrl: 'http://221.230.55.29:31919',
// baseUrl: 'https://c5a6-117-90-37-10.ap.ngrok.io',
// webUrl: 'https://smartwater.anxinyun.cn',
// pcode: 'fce4afe2-5b6a-408a-ab18-a2afa7fa027c',
imgUrl: 'http://test.resources.anxinyun.cn/',
// requestCache: true, //开启异步请求缓存
...baseConfig

3
weapp/src/packages/video/index.config.js

@ -0,0 +1,3 @@
export default {
navigationBarTitleText: '视频监控'
}

85
weapp/src/packages/video/index.jsx

@ -0,0 +1,85 @@
import React, { useState, useEffect } from 'react'
import Taro from '@tarojs/taro'
import { View, Image, Input, Picker, LivePlayer } from '@tarojs/components'
import request from '@/services/request'
import './index.scss'
import '../patrolView/index.scss'
import patrolIcon from '../../static/img/patrolView/patrol.svg'
import patrolActiveIcon from '../../static/img/patrolView/patrol-active.svg'
import conserveIcon from '../../static/img/patrolView/conserve.svg'
import conserveActiveIcon from '../../static/img/patrolView/conserve-active.svg'
import chevronDown from '../../static/img/patrolView/chevron-down.png'
import searchIcon from '../../static/img/patrolView/search.png'
function Index() {
const [isBus, setIsBus] = useState(true)
const [filterText, setFilterText] = useState('')
const [videoList, setVideoList] = useState([])
useEffect(() => {
getVideoList()
}, [])
const getVideoList = () => {
let nextVideoList = []
for (let i = 0; i < 10; i++) {
nextVideoList.push({ title: '视频' + i, url: '链接' + i })
}
setVideoList(nextVideoList)
}
const onTypeChange = bool => {
setIsBus(bool)
}
const handleConfirm = e => {
}
const handleInput = e => {
}
return (
<View>
<View className='type-box'>
<View className='item' onClick={() => onTypeChange(true)}>
<Image className='type-img' src={isBus ? patrolActiveIcon : patrolIcon} />
<View style={{ color: isBus ? '#346FC2' : '#999999' }}>公交</View>
</View>
<View className='line'></View>
<View className='item' onClick={() => onTypeChange(false)}>
<Image className='type-img' src={isBus ? conserveIcon : conserveActiveIcon} />
<View style={{ color: isBus ? '#999999' : '#346FC2' }}>道路</View>
</View>
</View>
<View className='filter-box'>
<View className='filter-item'>
<View style={{ float: 'left', marginLeft: '20rpx', color: '#333' }}>路段</View>
<Picker>
<View className='filter-name'>{'请选择'}</View>
<Image className='filter-img' src={chevronDown} />
</Picker>
</View>
<View class='head-search'>
<Image className='search-img' src={searchIcon} />
<Input class='heard-search-input' value={filterText} placeholder='请输入道路名称' onConfirm={handleConfirm} onInput={handleInput} />
</View>
</View>
<View className='video-box'>
{
videoList && videoList.map(v => {
return (
<View className='video-card'>
<View className='title'>{v.title}</View>
<LivePlayer className='video' src={v.url} mode='live' />
</View>
)
})
}
</View>
</View>
)
}
export default Index

28
weapp/src/packages/video/index.scss

@ -0,0 +1,28 @@
page {
background-color: #f6f6f6;
.video-box {
padding-top: 180px;
.video-card {
background-color: #fff;
height: 488px;
margin-bottom: 20px;
display: flex;
flex-direction: column;
align-items: left;
.title {
height: 88px;
margin-left: 30px;
display: flex;
align-items: center;
}
.video {
height: 400px;
width: 100%;
}
}
}
}

4
weapp/src/pages/home/index.jsx

@ -38,7 +38,9 @@ const Index = () => {
}
function toVideo() {
Taro.navigateTo({
url: '/packages/video/index'
})
}
return (

4
web/Dockerfile

@ -9,14 +9,14 @@ EXPOSE 8080
RUN npm config set registry=http://10.8.30.22:7000
RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json
RUN npm cache clean -f
RUN npm install --registry http://10.8.30.22:7000
RUN rm -rf package-lock.json
RUN npm install --registry http://10.8.30.22:7000
RUN npm run build
RUN rm -rf client/src
RUN rm -rf node_modules
RUN npm install --production --registry http://10.8.30.22:7000
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node-16:7.22-06-20
FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12
COPY --from=builder --chown=node /var/app /home/node/app

2
web/client/src/sections/quanju/containers/footer/conserve/left/left-center.js

@ -172,7 +172,7 @@ const LeftCenter = (props) => {
rich: {
a: {
backgroundColor: {
image: 'assets/images/quanju/circle2.png'
image: '/assets/images/quanju/circle2.png'
},
width: 15,
height: 15,

Loading…
Cancel
Save