This commit is contained in:
parent
e693d9b8be
commit
72bd0cfe84
2
App.vue
2
App.vue
|
|
@ -1,5 +1,4 @@
|
||||||
<script>
|
<script>
|
||||||
import soket from "/utils/soket.js"
|
|
||||||
import upapp from "/utils/upapp.js"
|
import upapp from "/utils/upapp.js"
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
|
@ -21,7 +20,6 @@
|
||||||
// #endif
|
// #endif
|
||||||
uni.setStorageSync('cid', _Android)
|
uni.setStorageSync('cid', _Android)
|
||||||
if (uni.getStorageSync('token')) {
|
if (uni.getStorageSync('token')) {
|
||||||
soket()
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/index",
|
url: "/pages/index",
|
||||||
success() {
|
success() {
|
||||||
|
|
|
||||||
|
|
@ -72,14 +72,16 @@
|
||||||
}
|
}
|
||||||
return _data;
|
return _data;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
day,
|
day,
|
||||||
monthGroups:Object.values(monthGroups)
|
monthGroups:Object.values(monthGroups)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
daydata.value = getCompleteMonthData()
|
daydata.value = getCompleteMonthData()
|
||||||
// chooseday.value=daydata.value.day[0]
|
|
||||||
|
|
||||||
|
|
||||||
|
reset()
|
||||||
function close(){
|
function close(){
|
||||||
Props.modelValue=false;
|
Props.modelValue=false;
|
||||||
adssEmits("update:modelValue",false)
|
adssEmits("update:modelValue",false)
|
||||||
|
|
@ -94,8 +96,9 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
function reset(){
|
function reset(){
|
||||||
// chooseday.value=daydata.value.day[0];
|
chooseday.value=daydata.value.day[0];
|
||||||
dayindex.value=0;
|
dayindex.value=0;
|
||||||
|
adssEmits("change",chooseday.value)
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
reset
|
reset
|
||||||
|
|
|
||||||
8
main.js
8
main.js
|
|
@ -1,5 +1,5 @@
|
||||||
import App from './App'
|
import App from './App'
|
||||||
|
import soket from "/utils/soket.js"
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import './uni.promisify.adaptor'
|
import './uni.promisify.adaptor'
|
||||||
|
|
@ -9,12 +9,16 @@ const app = new Vue({
|
||||||
...App
|
...App
|
||||||
})
|
})
|
||||||
app.$mount()
|
app.$mount()
|
||||||
|
soket()
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef VUE3
|
// #ifdef VUE3
|
||||||
import { createSSRApp } from 'vue'
|
import {
|
||||||
|
createSSRApp
|
||||||
|
} from 'vue'
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
|
soket()
|
||||||
return {
|
return {
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
"name" : "区间测速",
|
"name" : "区间测速",
|
||||||
"appid" : "__UNI__E207F22",
|
"appid" : "__UNI__E207F22",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.1",
|
||||||
"versionCode" : "100",
|
"versionCode" : 101,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
//配置跨域
|
//配置跨域
|
||||||
"proxy" : {
|
"proxy" : {
|
||||||
"/api" : {
|
"/api" : {
|
||||||
"target" : "http://speed-bl.renyizhi.cc",
|
"target" : "http://192.168.1.7:9005",
|
||||||
"changeOrigin" : true,
|
"changeOrigin" : true,
|
||||||
"secure" : false
|
"secure" : false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,10 @@
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
"navigationBarTitleText": "区间测速",
|
"navigationBarTitleText": "区间测速",
|
||||||
"navigationBarBackgroundColor": "#F8F8F8",
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
"pageOrientation": "portrait"
|
"pageOrientation": "portrait",
|
||||||
|
"app-plus": {
|
||||||
|
"bounce": "none"
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"uniIdRouter": {}
|
"uniIdRouter": {}
|
||||||
|
|
|
||||||
|
|
@ -13,31 +13,31 @@
|
||||||
<view class="tabnav">
|
<view class="tabnav">
|
||||||
<view class="li" :class="{on:selectindex==0}" @click="settab(0)">
|
<view class="li" :class="{on:selectindex==0}" @click="settab(0)">
|
||||||
<view class="l">
|
<view class="l">
|
||||||
<image src="/static/tab/1.png"></image>
|
<image :src="`/static/tab/${selectindex==0?11:1}.png`"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">预警信息</view>
|
<view class="text">预警信息</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li" :class="{on:selectindex==1}" @click="settab(1)">
|
<view class="li" :class="{on:selectindex==1}" @click="settab(1)">
|
||||||
<view class="l">
|
<view class="l">
|
||||||
<image src="/static/tab/2.png"></image>
|
<image :src="`/static/tab/${selectindex==1?22:2}.png`"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">过车信息</view>
|
<view class="text">过车信息</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li" :class="{on:selectindex==2}" @click="settab(2)">
|
<view class="li" :class="{on:selectindex==2}" @click="settab(2)">
|
||||||
<view class="l">
|
<view class="l">
|
||||||
<image src="/static/tab/3.png"></image>
|
<image :src="`/static/tab/${selectindex==2?33:3}.png`"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">历史记录</view>
|
<view class="text">历史记录</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li" :class="{on:selectindex==3}" @click="settab(3)">
|
<view class="li" :class="{on:selectindex==3}" @click="settab(3)">
|
||||||
<view class="l">
|
<view class="l">
|
||||||
<image src="/static/tab/4.png"></image>
|
<image :src="`/static/tab/${selectindex==3?44:4}.png`"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">统计数据</view>
|
<view class="text">统计数据</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li" :class="{on:selectindex==4}" @click="settab(4)">
|
<view class="li" :class="{on:selectindex==4}" @click="settab(4)">
|
||||||
<view class="l">
|
<view class="l">
|
||||||
<image src="/static/tab/5.png"></image>
|
<image :src="`/static/tab/${selectindex==4?55:5}.png`"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="text">预警设置</view>
|
<view class="text">预警设置</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -145,8 +145,10 @@
|
||||||
uni.$on('LOGOUT', () => {
|
uni.$on('LOGOUT', () => {
|
||||||
// 清除token
|
// 清除token
|
||||||
// 断WebSocket
|
// 断WebSocket
|
||||||
uni.$emit('Socketclose')
|
|
||||||
uni.removeStorageSync("token");
|
uni.removeStorageSync("token");
|
||||||
|
uni.removeStorageSync("USERID")
|
||||||
|
uni.$emit('Socketclose')
|
||||||
|
|
||||||
// h5 弹窗
|
// h5 弹窗
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
showout.value = true;
|
showout.value = true;
|
||||||
|
|
@ -170,7 +172,8 @@
|
||||||
// 退出登录
|
// 退出登录
|
||||||
function outsignOut() {
|
function outsignOut() {
|
||||||
showout.value = false;
|
showout.value = false;
|
||||||
|
uni.removeStorageSync("token");
|
||||||
|
uni.removeStorageSync("USERID")
|
||||||
// 跳转登录页
|
// 跳转登录页
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/signIn"
|
url: "/pages/signIn"
|
||||||
|
|
@ -181,8 +184,10 @@
|
||||||
|
|
||||||
function hidesub() {
|
function hidesub() {
|
||||||
_is = true;
|
_is = true;
|
||||||
|
// #ifdef APP
|
||||||
let subNVue = uni.getSubNVueById("hkcamera")
|
let subNVue = uni.getSubNVueById("hkcamera")
|
||||||
subNVue.hide('fade-out', 300)
|
subNVue.hide('fade-out', 300)
|
||||||
|
// #endif
|
||||||
showsignOut.value = false;
|
showsignOut.value = false;
|
||||||
uni.$emit("camerahide")
|
uni.$emit("camerahide")
|
||||||
|
|
||||||
|
|
@ -520,6 +525,8 @@
|
||||||
width: 600rpx;
|
width: 600rpx;
|
||||||
margin-left: 150rpx;
|
margin-left: 150rpx;
|
||||||
background: #E7E7ED;
|
background: #E7E7ED;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100vh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -17,7 +17,8 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="type==2">
|
<block v-else-if="type==2">
|
||||||
|
<block v-if="info.type">
|
||||||
<view class="fn fx" v-if="!yesok" @click="showupimg=true">放行</view>
|
<view class="fn fx" v-if="!yesok" @click="showupimg=true">放行</view>
|
||||||
<view class="fn yfx" :class="{aft:tips}" v-if="yesok" @click="setrelease">
|
<view class="fn yfx" :class="{aft:tips}" v-if="yesok" @click="setrelease">
|
||||||
确认放行
|
确认放行
|
||||||
|
|
@ -26,8 +27,17 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="fn fx grey" v-if="!yesok" @click="showtips">放行</view>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="fn fx" style="opacity: 0;">站位</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view :scroll-y="true" :scroll-top="scrolltop">
|
||||||
<view class="detailspage" @click="tips=false">
|
<view class="detailspage" @click="tips=false">
|
||||||
<view class="time">
|
<view class="time">
|
||||||
<view class="l">超速信息</view>
|
<view class="l">超速信息</view>
|
||||||
|
|
@ -160,6 +170,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="height: 20rpx;"></view>
|
<view style="height: 20rpx;"></view>
|
||||||
|
</scroll-view>
|
||||||
<view class="okfication" v-if="showupimg" @click.stop="showupimg=false">
|
<view class="okfication" v-if="showupimg" @click.stop="showupimg=false">
|
||||||
<view class="box" @click.stop="showupimg=true">
|
<view class="box" @click.stop="showupimg=true">
|
||||||
<view class="close" @click.stop="showupimg=false"> <uni-icons type="closeempty" color="#585757"
|
<view class="close" @click.stop="showupimg=false"> <uni-icons type="closeempty" color="#585757"
|
||||||
|
|
@ -199,7 +210,7 @@
|
||||||
detainVehicle,
|
detainVehicle,
|
||||||
releaseVehicle
|
releaseVehicle
|
||||||
} from "/appapi/index.js"
|
} from "/appapi/index.js"
|
||||||
|
const scrolltop=ref(0)
|
||||||
const type = ref("");
|
const type = ref("");
|
||||||
const showupimg = ref(false)
|
const showupimg = ref(false)
|
||||||
const yesok = ref(false);
|
const yesok = ref(false);
|
||||||
|
|
@ -210,6 +221,35 @@
|
||||||
const info=ref({})
|
const info=ref({})
|
||||||
|
|
||||||
const time=ref("")
|
const time=ref("")
|
||||||
|
let timer;
|
||||||
|
|
||||||
|
function showtips(){
|
||||||
|
uni.showToast({
|
||||||
|
title:"未到放行时间",
|
||||||
|
icon:"error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新放行状态
|
||||||
|
// 只在是暂扣点进来的时候
|
||||||
|
function upreleasetype(){
|
||||||
|
// 清除定制任务 避免多个定时任务
|
||||||
|
clearInterval(timer)
|
||||||
|
function gettype(){
|
||||||
|
if(new Date().getTime()>new Date(info.value.detainInfo.restDurationEndtime).getTime()){
|
||||||
|
// 可放行
|
||||||
|
info.value['type']=1;
|
||||||
|
}else{
|
||||||
|
// 不可放行
|
||||||
|
info.value['type']=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gettype()
|
||||||
|
// 重启定时任务
|
||||||
|
timer=setInterval(()=>{
|
||||||
|
gettype()
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
watch(()=>showupimg.value,()=>{
|
watch(()=>showupimg.value,()=>{
|
||||||
formatTime()
|
formatTime()
|
||||||
|
|
@ -300,12 +340,19 @@
|
||||||
encoding.value=id;
|
encoding.value=id;
|
||||||
type.value = indextype
|
type.value = indextype
|
||||||
showupimg.value = true;
|
showupimg.value = true;
|
||||||
|
scrolltop.value=10;
|
||||||
getinfo()
|
getinfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getinfo(){
|
function getinfo(){
|
||||||
getdetails({encoding:encoding.value}).then(res=>{
|
getdetails({encoding:encoding.value}).then(res=>{
|
||||||
info.value=res.data;
|
info.value=res.data;
|
||||||
|
scrolltop.value=0;
|
||||||
|
if(type.value==2){
|
||||||
|
|
||||||
|
upreleasetype()
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 确认暂扣
|
// 确认暂扣
|
||||||
|
|
@ -357,6 +404,10 @@
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
scroll-view{
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: calc(100vh - 35rpx);
|
||||||
|
}
|
||||||
.okfication {
|
.okfication {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
|
|
@ -364,7 +415,7 @@
|
||||||
left: 0px;
|
left: 0px;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
z-index: 22;
|
||||||
.box {
|
.box {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 340rpx;
|
width: 340rpx;
|
||||||
|
|
@ -386,8 +437,8 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 46rpx;
|
width: 31rpx;
|
||||||
height: 46rpx;
|
height: 31rpx;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -460,11 +511,11 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 15rpx;
|
padding: 10rpx 15rpx;
|
||||||
background: #E7E7ED;
|
background: #E7E7ED;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0rpx;
|
top: 0rpx;
|
||||||
|
z-index: 22;
|
||||||
.back {
|
.back {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -542,7 +593,9 @@
|
||||||
&.fx {
|
&.fx {
|
||||||
background: #08A05F;
|
background: #08A05F;
|
||||||
}
|
}
|
||||||
|
&.grey{
|
||||||
|
background: #666666;
|
||||||
|
}
|
||||||
&.yfx {
|
&.yfx {
|
||||||
background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%);
|
background: linear-gradient(45deg, #4F8AFF 0%, #4B5EFF 100%);
|
||||||
}
|
}
|
||||||
|
|
@ -553,7 +606,7 @@
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 8rpx;
|
border-radius: 8rpx;
|
||||||
margin: 1rpx 15rpx;
|
margin: 1rpx 15rpx;
|
||||||
padding: 15rpx;
|
padding:10rpx 15rpx;
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -574,23 +627,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
margin: 15rpx 0;
|
margin: 10rpx 0rpx 0rpx;
|
||||||
border-radius: 3rpx;
|
border-radius: 3rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid #979797;
|
border: 1px solid #A0A0A0;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
// align-items: center;
|
// align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid #979797;
|
border-bottom: 1px solid #A0A0A0;
|
||||||
|
|
||||||
&>view {
|
&>view {
|
||||||
&:nth-last-of-type(1) {
|
&:nth-last-of-type(1) {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
border-right: 1px solid #979797;
|
border-right: 1px solid #A0A0A0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-last-of-type(1) {
|
&:nth-last-of-type(1) {
|
||||||
|
|
@ -613,7 +666,7 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 9rpx;
|
font-size: 9rpx;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 7rpx;
|
padding:10rpx 7rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -635,7 +688,7 @@
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin: 7rpx 0;
|
margin: 10rpx 0;
|
||||||
font-size: 11rpx;
|
font-size: 11rpx;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
@ -672,7 +725,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.tbody {
|
.tbody {
|
||||||
border: 1px solid #979797;
|
border: 1px solid #A0A0A0;
|
||||||
border-radius: 3rpx;
|
border-radius: 3rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
|
@ -684,7 +737,7 @@
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
border-bottom: 1px solid #979797;
|
border-bottom: 1px solid #A0A0A0;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 9rpx;
|
font-size: 9rpx;
|
||||||
|
|
@ -692,8 +745,8 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background: #F3F5F8;
|
background: #F3F5F8;
|
||||||
padding: 7rpx;
|
padding: 7rpx;
|
||||||
border-left: 1px solid #979797;
|
border-left: 1px solid #A0A0A0;
|
||||||
border-right: 1px solid #979797;
|
border-right: 1px solid #A0A0A0;
|
||||||
|
|
||||||
&:nth-of-type(1) {
|
&:nth-of-type(1) {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,10 @@
|
||||||
<view>{{item.restDurationText}}</view>
|
<view>{{item.restDurationText}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="right " :class="{red:item.status==2}">{{item.statusText}}</view>
|
<view class="right " :class="{red:item.status==2}">{{item.statusText}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="height: 10rpx;"></view>
|
||||||
<nynull txt="暂无历史数据" v-if="!list.length"></nynull>
|
<nynull txt="暂无历史数据" v-if="!list.length"></nynull>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<pageanimation v-model="showdetails" @close="refdetails.hide()" >
|
<pageanimation v-model="showdetails" @close="refdetails.hide()" >
|
||||||
|
|
@ -120,9 +122,10 @@
|
||||||
}
|
}
|
||||||
// 重置
|
// 重置
|
||||||
function reset(){
|
function reset(){
|
||||||
Selectiondate.value.reset();
|
|
||||||
queryDate.value="";
|
queryDate.value="";
|
||||||
vehicleNumber.value=""
|
vehicleNumber.value=""
|
||||||
|
Selectiondate.value.reset();
|
||||||
showdate.value=false;
|
showdate.value=false;
|
||||||
hasNextPage.value=true;
|
hasNextPage.value=true;
|
||||||
pageNum.value=1;
|
pageNum.value=1;
|
||||||
|
|
@ -148,11 +151,9 @@
|
||||||
|
|
||||||
|
|
||||||
.scroll-view {
|
.scroll-view {
|
||||||
height: calc(100vh - 70rpx);
|
height: calc(100vh - 60rpx);
|
||||||
padding: 1rpx 15rpx;
|
padding: 1rpx 15rpx;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -162,43 +163,35 @@
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 10rpx 15rpx;
|
padding: 10rpx 15rpx;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
.t {
|
.t {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 9rpx;
|
font-size: 9rpx;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 13rpx;
|
width: 13rpx;
|
||||||
height: 13rpx;
|
height: 13rpx;
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
width: 81rpx;
|
width: 81rpx;
|
||||||
line-height: 20rpx;
|
line-height: 20rpx;
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: 11rpx;
|
font-size: 11rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
border-radius: 5rpx;
|
border-radius: 5rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1rpx solid rgba(162, 181, 207, 0.67);
|
border: 1rpx solid rgba(162, 181, 207, 0.67);
|
||||||
|
|
||||||
.thead {
|
.thead {
|
||||||
background: rgba(162, 181, 207, 0.13);
|
background: rgba(162, 181, 207, 0.13);
|
||||||
padding: 7rpx 0;
|
padding: 7rpx 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
width: 90rpx;
|
width: 90rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -206,7 +199,6 @@
|
||||||
color: #76849D;
|
color: #76849D;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -217,7 +209,6 @@
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translate(-0, -50%);
|
transform: translate(-0, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-of-type(1) {
|
&:nth-of-type(1) {
|
||||||
&:before {
|
&:before {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
@ -225,10 +216,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tbody {
|
.tbody {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 7rpx 0;
|
padding: 7rpx 0;
|
||||||
|
|
@ -238,9 +227,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
|
|
||||||
font-size: 11rpx;
|
font-size: 11rpx;
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<view v-for="item in devices" :class="{on:deviceId==item.encoding}" @click="setdeviceid(item.encoding)">设备{{item.encoding}}</view>
|
<view v-for="item in devices" :class="{on:deviceId==item.encoding}" @click="setdeviceid(item.encoding)">设备{{item.encoding}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="r">
|
<view class="r">
|
||||||
{{infodata.queryTime}}
|
{{timeFormat(getdata,"yyyy年mm月dd日hh时MM分ss秒")}}
|
||||||
<view>区间测速实时监测中</view>
|
<view>区间测速实时监测中</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -15,7 +15,8 @@
|
||||||
<view class="title">当天过车数量</view>
|
<view class="title">当天过车数量</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="num">{{infodata.lastMonitoringTime}}</view>
|
<view class="num" v-if="list.length">{{showday}}</view>
|
||||||
|
<view class="num" v-if="!list.length">-</view>
|
||||||
<view class="title">距离最后一次监测,已过去:</view>
|
<view class="title">距离最后一次监测,已过去:</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -46,12 +47,12 @@
|
||||||
const devices=ref([]);
|
const devices=ref([]);
|
||||||
const infodata=ref({})
|
const infodata=ref({})
|
||||||
const list=ref([])
|
const list=ref([])
|
||||||
|
import { timeFormat } from '@/uni_modules/uv-ui-tools/libs/function/index.js';
|
||||||
// 分页相关
|
// 分页相关
|
||||||
const pageSize=ref(40);
|
const pageSize=ref(40);
|
||||||
const pageNum=ref(1);
|
const pageNum=ref(1);
|
||||||
const hasNextPage=ref(true)
|
const hasNextPage=ref(true)
|
||||||
|
const getdata=ref(new Date().getTime())
|
||||||
function load() {
|
function load() {
|
||||||
console.log('过车信息load')
|
console.log('过车信息load')
|
||||||
}
|
}
|
||||||
|
|
@ -82,33 +83,60 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取过车信息
|
// 获取过车信息
|
||||||
|
const daytiem=ref(new Date().getTime());
|
||||||
|
const showday=ref("刚刚")
|
||||||
|
let _eliminate;
|
||||||
function getinfo() {
|
function getinfo() {
|
||||||
|
clearInterval(_eliminate)
|
||||||
getpassingTheCar({deviceId:deviceId.value,pageNum:pageNum.value,pageSize:pageSize.value}).then(r=>{
|
getpassingTheCar({deviceId:deviceId.value,pageNum:pageNum.value,pageSize:pageSize.value}).then(r=>{
|
||||||
infodata.value=r.data;
|
infodata.value=r.data;
|
||||||
|
daytiem.value=r.data.vehicleList[0]?new Date(r.data.vehicleList[0].queryTime).getTime():0;
|
||||||
list.value=list.value.concat(r.data.vehicleList)
|
list.value=list.value.concat(r.data.vehicleList)
|
||||||
hasNextPage.value=r.data.hasNextPage
|
hasNextPage.value=r.data.hasNextPage;
|
||||||
|
settiem()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 触底
|
// 触底
|
||||||
function bottomingOut(){
|
function bottomingOut(){
|
||||||
if(hasNextPage.value){
|
// if(hasNextPage.value){
|
||||||
pageNum.value=pageNum.value+1;
|
// pageNum.value=pageNum.value+1;
|
||||||
getinfo()
|
// getinfo()
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听推送数据
|
// 监听推送数据
|
||||||
let _clet;
|
|
||||||
uni.onSkt("SERCHNEWDATA", (res) => {
|
uni.onSkt("SERCHNEWDATA", (res) => {
|
||||||
// console.log(res)
|
if(res.deviceId==deviceId.value){
|
||||||
// scroll.value=10;
|
list.value = [...res.viewList, ...list.value]
|
||||||
list.value = [...res, ...list.value]
|
infodata.value.todayCount=infodata.value.todayCount+res.viewList.length;
|
||||||
// clearTimeout(_clet)
|
daytiem.value=new Date().getTime();
|
||||||
// _clet=setTimeout(()=>{
|
clearInterval(_eliminate)
|
||||||
// scroll.value=0;
|
settiem()
|
||||||
// },500)
|
}
|
||||||
|
|
||||||
// 预警列表接收推送数据
|
// 预警列表接收推送数据
|
||||||
})
|
})
|
||||||
|
function timeAgo() {
|
||||||
|
const now = new Date();
|
||||||
|
const past = new Date(daytiem.value);
|
||||||
|
const seconds = Math.floor((now - past) / 1000);
|
||||||
|
const minutes = Math.floor(seconds / 60);
|
||||||
|
const hours = Math.floor(minutes / 60);
|
||||||
|
const days = Math.floor(hours / 24);
|
||||||
|
const years = Math.floor(days / 365);
|
||||||
|
if (years > 0) return `${years}年前`;
|
||||||
|
if (days > 0) return `${days}天前`;
|
||||||
|
if (hours > 0) return `${hours}小时前`;
|
||||||
|
if (minutes > 0) return `${minutes}分钟前`;
|
||||||
|
return `${seconds}秒前`;
|
||||||
|
}
|
||||||
|
function settiem(){
|
||||||
|
_eliminate=setInterval(()=>{
|
||||||
|
getdata.value=new Date().getTime()
|
||||||
|
showday.value=timeAgo()
|
||||||
|
},500)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 重置
|
// 重置
|
||||||
function reset(){
|
function reset(){
|
||||||
|
|
@ -206,7 +234,7 @@
|
||||||
|
|
||||||
scroll-view {
|
scroll-view {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: calc(100vh - 175rpx);
|
height: calc(100vh - 160rpx);
|
||||||
|
|
||||||
.li {
|
.li {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -230,7 +258,7 @@
|
||||||
border-radius: 3rpx;
|
border-radius: 3rpx;
|
||||||
margin-left: 15rpx;
|
margin-left: 15rpx;
|
||||||
|
|
||||||
font-weight: 800;
|
|
||||||
font-size: 11rpx;
|
font-size: 11rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -58,32 +58,31 @@
|
||||||
script.src = 'static/echarts.min.js'
|
script.src = 'static/echarts.min.js'
|
||||||
document.head.appendChild(script)
|
document.head.appendChild(script)
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(e) {
|
init(e) {
|
||||||
if (!window.echarts) {
|
if (!window.echarts) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
updata(r) {
|
updata(r) {
|
||||||
|
|
||||||
if (window.echarts && r.overspeedStatistics) {
|
if (window.echarts && r.overspeedStatistics) {
|
||||||
let allnum=r.overspeedStatistics.overspeedOver50+r.overspeedStatistics.overspeed20To50+r.overspeedStatistics.overspeed10To20+r.overspeedStatistics.overspeedUnder10
|
let allnum = r.overspeedStatistics.overspeedOver50 + r.overspeedStatistics.overspeed20To50 + r
|
||||||
|
.overspeedStatistics.overspeed10To20 + r.overspeedStatistics.overspeedUnder10
|
||||||
myChart = echarts.init(document.getElementById("echart"))
|
myChart = echarts.init(document.getElementById("echart"))
|
||||||
myChart.setOption({
|
myChart.setOption({
|
||||||
grid: {
|
grid: {
|
||||||
top: 20,
|
top: 20,
|
||||||
right: 0,
|
// right: 0,
|
||||||
bottom: 15,
|
bottom: 15,
|
||||||
left: 0,
|
left: 0,
|
||||||
|
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'value',
|
type: 'value',
|
||||||
axisLabel: { interval: 0 }
|
axisLabel: {
|
||||||
|
interval: 0
|
||||||
|
}
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
|
|
@ -96,65 +95,53 @@
|
||||||
color: "#4D7BFF",
|
color: "#4D7BFF",
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
show: true,
|
||||||
position: 'right',
|
position: 'insideRight',
|
||||||
interval: 0,
|
interval: 0,
|
||||||
formatter:function(a){
|
color:"#fff",
|
||||||
return Number(a.value/allnum*100 || 0).toFixed(2)+'%';
|
textMargin: [0, 100],
|
||||||
|
formatter :function(a){
|
||||||
|
return a.value?a.value:""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emphasis:{
|
emphasis: {
|
||||||
disabled:true
|
disabled: true
|
||||||
},
|
},
|
||||||
data: [
|
markPoint: {
|
||||||
r.overspeedStatistics.overspeedOver50,
|
symbolSize: 0,
|
||||||
r.overspeedStatistics.overspeed20To50,
|
symbol: "pin",
|
||||||
r.overspeedStatistics.overspeed10To20,
|
|
||||||
r.overspeedStatistics.overspeedUnder10,
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
barGap: "-100%",
|
|
||||||
silent: true,
|
|
||||||
barWidth: 20,
|
|
||||||
type: 'bar',
|
|
||||||
color: "#4D7BFF",
|
|
||||||
label: {
|
label: {
|
||||||
show: true,
|
color: "#000",
|
||||||
position: 'insideTopRight',
|
position:"right"
|
||||||
color: "#fff"
|
|
||||||
},
|
|
||||||
emphasis:{
|
|
||||||
disabled:true
|
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
r.overspeedStatistics.overspeedOver50,
|
{
|
||||||
r.overspeedStatistics.overspeed20To50,
|
value: Number(r.overspeedStatistics.overspeedOver50/allnum*100 || 0).toFixed(2)+'%',
|
||||||
r.overspeedStatistics.overspeed10To20,
|
xAxis: r.overspeedStatistics.overspeedOver50,
|
||||||
r.overspeedStatistics.overspeedUnder10,
|
yAxis: 0
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
barGap: "-100%",
|
value: Number(r.overspeedStatistics.overspeed20To50/allnum*100 || 0).toFixed(2)+'%',
|
||||||
silent: true,
|
xAxis: r.overspeedStatistics.overspeed20To50,
|
||||||
barWidth: 20,
|
yAxis: 1
|
||||||
type: 'bar',
|
},
|
||||||
|
{
|
||||||
|
value: Number(r.overspeedStatistics.overspeed10To20/allnum*100 || 0).toFixed(2)+'%',
|
||||||
|
xAxis: r.overspeedStatistics.overspeed10To20,
|
||||||
|
yAxis: 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: Number(r.overspeedStatistics.overspeedUnder10/allnum*100 || 0).toFixed(2)+'%',
|
||||||
|
xAxis: r.overspeedStatistics.overspeedUnder10,
|
||||||
|
yAxis: 3
|
||||||
|
},
|
||||||
|
|
||||||
itemStyle:{
|
]
|
||||||
color: "rgba(255,255,255,0)",
|
|
||||||
},
|
|
||||||
emphasis:{
|
|
||||||
disabled:true
|
|
||||||
},
|
|
||||||
label: {
|
|
||||||
show: true,
|
|
||||||
position: 'insideTopRight',
|
|
||||||
color: "#fff"
|
|
||||||
},
|
},
|
||||||
data: [
|
data: [
|
||||||
r.overspeedStatistics.overspeed50Plus+10,
|
r.overspeedStatistics.overspeedOver50,
|
||||||
r.overspeedStatistics.overspeed20To50+10,
|
r.overspeedStatistics.overspeed20To50,
|
||||||
r.overspeedStatistics.overspeed10To20+10,
|
r.overspeedStatistics.overspeed10To20,
|
||||||
r.overspeedStatistics.overspeedUnder10+10,
|
r.overspeedStatistics.overspeedUnder10,
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,11 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right red" v-if="status==2" @click.stop="withhold(item.encoding,1)">暂扣</view>
|
<view class="right red" v-if="status==2" @click.stop="withhold(item.encoding,1)">暂扣</view>
|
||||||
<view class="right green" v-if="status==3" @click.stop="withhold(item.encoding,2)">放行</view>
|
|
||||||
|
<view class="right grey" v-if="status==3 && !item.type" @click.stop="tips">放行</view>
|
||||||
|
<view class="right green" v-if="status==3 && item.type" @click.stop="withhold(item.encoding,2)">放行</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="height: 10rpx;"></view>
|
||||||
<nynull v-if="!info.data?.length"></nynull>
|
<nynull v-if="!info.data?.length"></nynull>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<pageanimation v-model="showdetails" @close="refdetails.hide()">
|
<pageanimation v-model="showdetails" @close="refdetails.hide()">
|
||||||
|
|
@ -113,7 +116,7 @@
|
||||||
const pageSize = ref(50);
|
const pageSize = ref(50);
|
||||||
const pageNum = ref(1);
|
const pageNum = ref(1);
|
||||||
const hasNextPage = ref(true)
|
const hasNextPage = ref(true)
|
||||||
|
let timer;
|
||||||
|
|
||||||
const info = ref({
|
const info = ref({
|
||||||
data: []
|
data: []
|
||||||
|
|
@ -123,6 +126,37 @@
|
||||||
function load() {
|
function load() {
|
||||||
console.log('预警信息load')
|
console.log('预警信息load')
|
||||||
}
|
}
|
||||||
|
function tips(){
|
||||||
|
uni.showToast({
|
||||||
|
title:"未到放行时间",icon:"error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新放行状态
|
||||||
|
upreleasetype()
|
||||||
|
function upreleasetype(){
|
||||||
|
// 清除定制任务 避免多个定时任务
|
||||||
|
clearInterval(timer)
|
||||||
|
function gettype(){
|
||||||
|
// 只有暂扣车辆列表
|
||||||
|
if(status.value==3){
|
||||||
|
info.value.data.map((res,index)=>{
|
||||||
|
if(new Date().getTime()>new Date(res.restDurationEndtime).getTime()){
|
||||||
|
// 可放行
|
||||||
|
info.value.data[index]['type']=1;
|
||||||
|
}else{
|
||||||
|
// 不可放行
|
||||||
|
info.value.data[index]['type']=0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gettype()
|
||||||
|
// 重启定时任务
|
||||||
|
timer=setInterval(()=>{
|
||||||
|
gettype()
|
||||||
|
},1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function opneshowdetails() {
|
function opneshowdetails() {
|
||||||
showdetails.value = true;
|
showdetails.value = true;
|
||||||
|
|
@ -181,9 +215,7 @@
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
getinfo()
|
getinfo()
|
||||||
// #ifdef APP
|
|
||||||
uni.setAppBadgeNumber(0)
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const itemanimation=ref(false)
|
const itemanimation=ref(false)
|
||||||
|
|
@ -231,9 +263,9 @@
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.scroll-view {
|
.scroll-view {
|
||||||
height: calc(100vh - 140rpx);
|
height: calc(100vh - 110rpx);
|
||||||
padding: 1rpx 15rpx;
|
padding: 1rpx 15rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
|
|
@ -286,7 +318,7 @@
|
||||||
margin-top: 8rpx;
|
margin-top: 8rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
font-weight: 800;
|
|
||||||
font-size: 11rpx;
|
font-size: 11rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -453,7 +485,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
font-weight: 800;
|
|
||||||
font-size: 13rpx;
|
font-size: 13rpx;
|
||||||
color: #4D7BFF;
|
color: #4D7BFF;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
import {
|
import {
|
||||||
applogin
|
applogin
|
||||||
} from "/appapi/index.js"
|
} from "/appapi/index.js"
|
||||||
import soket from "/utils/soket.js"
|
|
||||||
import {
|
import {
|
||||||
onShow
|
onShow
|
||||||
} from "@dcloudio/uni-app"
|
} from "@dcloudio/uni-app"
|
||||||
|
|
@ -80,9 +80,7 @@
|
||||||
password: password.value,
|
password: password.value,
|
||||||
deviceType: " android"
|
deviceType: " android"
|
||||||
}).then(r => {
|
}).then(r => {
|
||||||
// 创建soket连接
|
|
||||||
uni.setStorageSync('USERID', r.data.user.userId)
|
uni.setStorageSync('USERID', r.data.user.userId)
|
||||||
soket()
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/index"
|
url: "/pages/index"
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue