Commit c161b682 authored by xxx's avatar xxx

1

parent 39cb5713
......@@ -59,6 +59,7 @@
<script>
import { Tools, HttpReq, Dates} from '@/assets/js/common.js';
import * as echarts from 'echarts';
import axios from 'axios'
export default {
data() {
......@@ -85,12 +86,23 @@ export default {
total:30,
handle:10,
},
//所有车的信息
allCarData:'',
};
},
mounted() {
this.getCode();
this.echarts1Fn();
this.echarts2Fn();
HttpReq.truckDispatching.carMonitoringCarsQuery({size: 9999}).then((res) => {
let arr1 = '';
res.content.forEach((item,index)=>{
arr1 = arr1 + item.carnumber + ',';
})
arr1 = arr1.substring(0, arr1.length - 1);
this.allCarData = arr1;
this.aiTabPositionFn();
})
},
methods: {
getCode() {
......@@ -133,7 +145,25 @@ export default {
}
},
aiTabPositionFn(){
console.log(this.aiTabPosition);
if(this.aiTabPosition == '今天'){
let start = this.currentTime1(new Date(new Date(new Date().toLocaleDateString()).getTime()));
let end = this.currentTime1(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1));
//可配置参数的方式
axios.get('/jiankong', {
params: {
jsession:'1bf84ae637b843f2af24cf8c1502e9cf',
vehiIdno:'202208221701',
begintime:start,
endtime:end,
armType:'670,671,620,621,624,625,400',
currentPage:0,
pageRecords:9999,
}
}).then(function (response) {
console.log(response.data.alarms);
})
}
},
//饼图1
echarts1Fn(){
......@@ -283,6 +313,38 @@ export default {
noPtzCloseFn(){
this.noPtz = false;
},
//转换时间格式(yyyy-mm-dd hh:mm:ss)
currentTime1(time){
var date = new Date(time);
var year = date.getFullYear(); //年 ,从 Date 对象以四位数字返回年份
var month = date.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
var day = date.getDate(); //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
var hours = date.getHours(); //小时 ,返回 Date 对象的小时 (0 ~ 23)
var minutes = date.getMinutes(); //分钟 ,返回 Date 对象的分钟 (0 ~ 59)
var seconds = date.getSeconds(); //秒 ,返回 Date 对象的秒数 (0 ~ 59)
//修改月份格式
if (month >= 1 && month <= 9) {
month = "0" + month;
}
//修改日期格式
if (day >= 0 && day <= 9) {
day = "0" + day;
}
//修改小时格式
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
//修改分钟格式
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
//修改秒格式
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
let currentFormatDate = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
return currentFormatDate;
},
},
//销毁
beforeDestroy() {
......
......@@ -46,6 +46,13 @@ module.exports = {
'^/auth': 'auth'
}
},
'/jiankong': {
target: 'http://120.224.103.84:8088/StandardApiAction_queryAlarmDetail.action',
changeOrigin: true,
pathRewrite: {
'^/jiankong': ''
}
},
'/dianziweilan': {
target: process.env.VUE_APP_BASE_API,
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment