@ -24,11 +24,11 @@
< el -form -item :label ="t('web.GPSTime')" prop = "internationalization3" >
< el -date -picker
v - model = "dateRange"
value - format = "YYYY-MM-DD"
type = "daterange"
range - separator = "-"
: start - placeholder = "t('common.startDate')"
: end - placeholder = "t('common.endDate')"
: start - placeholder = "t('common.startDate')"
range - separator = "-"
type = "daterange"
value - format = "YYYY-MM-DD"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = " " >
@ -38,86 +38,57 @@
< / e l - f o r m >
<!-- 顶部操作按钮 -- >
< el -row :gutter ="10" class = "mb8" >
< el -col :span ="1.5" >
< el -button
v - hasPermi = "['test:test:export']"
icon = "Download"
plain
type = "warning"
@ click = "handleExport"
> { { t ( 'option.export' ) } }
< / e l - b u t t o n >
< / e l - c o l >
< right -toolbar v -model :showSearch ="showSearch" @queryTable ="getList" > < / right -toolbar >
< / e l - r o w >
<!-- < el -row :gutter ="10" class = "mb8" > -- >
<!-- < el -col :span ="1.5" > -- >
<!-- < el -button - - >
<!-- v - hasPermi = "['test:test:export']" -- >
<!-- icon = "Download" -- >
<!-- plain -- >
<!-- type = "warning" -- >
<!-- @ click = "handleExport" -- >
<!-- > { { t ( 'option.export' ) } } -- >
<!-- < / e l - b u t t o n > - - >
<!-- < / e l - c o l > - - >
<!-- < right -toolbar v -model :showSearch ="showSearch" @queryTable ="getList" > < / right -toolbar > -- >
<!-- < / e l - r o w > - - >
<!-- 表格主体 -- >
< el -table v-loading ="loading" :data="postList" @selection-change="handleSelectionChange" >
< el -table -column align = "center" fixed type = "selection" width = "55" / >
< el -table -column :label ="t('web.SerialNumber')" align = "center" type = "index" width = "120" / >
<!-- < el -table -column label = "GPS时间" align = "center" prop = "internationalization2" - - >
<!-- width = "150" / > -- >
< el -table -column :label ="t('web.TransceiverID')" align = "center" prop = "machineId"
width = "150" / >
< el -table -column :label ="t('web.licensePlateNumber')" align = "center" prop = "carLicense"
width = "150" / >
< el -table -column :label ="t('baseCar.car.latitude')" align = "center" prop = "latitude"
/ >
< el -table -column :label ="t('baseCar.car.longitude')" align = "center" prop = "longitude"
/ >
<!-- < el -table -column label = "GPS里程" align = "center" prop = "gpsMileage" - - >
<!-- / > - - >
< el -table -column :label ="t('web.altitude')" align = "center" prop = "altitude"
/ >
< el -table -column :label ="t('web.speed')" align = "center" prop = "speed"
/ >
<!-- < el -table -column label = "方向" align = "center" prop = "course" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "是否外接电源" align = "center" prop = "isOutPower" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "设备上传电池电压" align = "center" prop = "carPower" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "胎压设备是否正常工作" align = "center" prop = "isSensorRun" - - >
<!-- width = "170" / > -- >
<!-- < el -table -column label = "紧急报警" align = "center" prop = "emergencyAlarm" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "超速预警" align = "center" prop = "speedAlarm" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "疲劳驾驶" align = "center" prop = "fatigueDrivingAlarm" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "危险预警" align = "center" prop = "riskEarlyAlarm" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "gnss模块" align = "center" prop = "gnssModule" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "天线缺失" align = "center" prop = "gnssLossAntenna" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "天线短路" align = "center" prop = "gnssAntennaShortcircuit" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "终端主电源欠压" align = "center" prop = "mainPowerLake" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column label = "终端主电源掉电" align = "center" prop = "mainpowerloss" - - >
<!-- width = "150" / > -- >
< / e l - t a b l e >
<!-- < el -table v-loading ="loading" :data="postList" @selection-change="handleSelectionChange" > - - >
<!-- < el -table -column align = "center" fixed type = "selection" width = "55" / > -- >
<!-- < el -table -column :label ="t('web.TransceiverID')" align = "center" prop = "machineId" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column :label ="t('web.licensePlateNumber')" align = "center" prop = "carLicense" - - >
<!-- width = "150" / > -- >
<!-- < el -table -column :label ="t('baseCar.car.latitude')" align = "center" prop = "latitude" - - >
<!-- / > - - >
<!-- < el -table -column :label ="t('baseCar.car.longitude')" align = "center" prop = "longitude" - - >
<!-- / > - - >
<!-- < el -table -column :label ="t('web.altitude')" align = "center" prop = "altitude" - - >
<!-- / > - - >
<!-- < el -table -column :label ="t('web.speed')" align = "center" prop = "speed" - - >
<!-- / > - - >
<!-- < / e l - t a b l e > - - >
<!-- 分页 -- >
< pagination
v - show = "total > 0"
v - model : limit = "queryParams.pageSize"
v - model : page = "queryParams.pageNum"
: total = "total"
@ pagination = "getList"
/ >
<!-- < pagination - - >
<!-- v - show = "total > 0" -- >
<!-- v - model : limit = "queryParams.pageSize" -- >
<!-- v - model : page = "queryParams.pageNum" -- >
<!-- : total = "total" -- >
<!-- @ pagination = "getList" -- >
<!-- / > - - >
< div id = "myChart" class = "myChart" > < / div >
< / div >
< / template >
< script name = "Car" setup >
import { listTest } from "@/api/GPS/car" ;
import { listTest } from "@/api/GPS/car" ;
import { useI18n } from 'vue-i18n' ;
import Cookies from "js-cookie" ;
import * as echarts from 'echarts' ;
const { t } = useI18n ( ) ;
const locale = ( Cookies . get ( 'language' ) || 'zhCn' ) === 'zhCn'
@ -135,12 +106,13 @@ const dateRange = ref([]);
/ / 搜 索 参 数
const queryParams = ref ( {
pageNum : 1 ,
pageSize : 10 ,
/ / p a g e N u m : 1 ,
/ / p a g e S i z e : 1 0 ,
carLicense : undefined ,
machineId : undefined ,
internationalization3 : undefined ,
} )
console . log ( echarts )
/** 查询岗位列表 */
function getList ( ) {
@ -148,6 +120,91 @@ function getList() {
listTest ( proxy . addDateRange ( queryParams . value , dateRange . value ) ) . then ( response => {
postList . value = response . rows ;
total . value = response . total ;
let chart = echarts . init ( document . getElementById ( 'myChart' ) )
chart . setOption ( {
legend : {
icon : "circle" ,
top : "0%" ,
right : "5%" ,
itemWidth : 6 ,
itemGap : 20 ,
textStyle : {
color : "#556677" ,
} ,
} ,
tooltip : {
trigger : "axis" ,
} ,
grid : {
left : '3%' ,
right : '4%' ,
bottom : '3%' ,
containLabel : true
} ,
xAxis : [
{
type : "category" ,
data : response . rows . map ( e => e . createTime ) ,
axisLine : {
lineStyle : {
color : "#DCE2E8" ,
} ,
} ,
axisTick : {
show : false ,
} ,
} ,
] ,
yAxis : [
{
type : 'value' ,
name : '里程' ,
axisLabel : {
formatter : '{value} KM'
}
} ,
{
type : 'value' ,
name : '花纹深度' ,
axisLabel : {
formatter : '{value} mm'
}
}
] ,
series : [
{
name : "海拔" ,
type : "line" ,
data : response . rows . map ( e => e . altitude || 0 ) ,
symbolSize : 1 ,
symbol : "circle" ,
smooth : true ,
yAxisIndex : 0 ,
showSymbol : false ,
tooltip : {
valueFormatter : function ( value ) {
return value + ' km' ;
}
} ,
} ,
{
name : "速度" ,
type : "line" ,
data : response . rows . map ( e => e . speed || 0 ) ,
symbolSize : 1 ,
yAxisIndex : 1 ,
symbol : "circle" ,
smooth : true ,
showSymbol : false ,
tooltip : {
valueFormatter : function ( value ) {
return value + ' km/h' ;
}
} ,
} ,
] ,
} )
} ) . finally ( ( ) => {
loading . value = false ;
} ) ;
@ -155,7 +212,7 @@ function getList() {
/** 搜索按钮操作 */
function handleQuery ( ) {
queryParams . value . pageNum = 1 ;
/ / q u e r y P a r a m s . v a l u e . p a g e N u m = 1 ;
getList ( ) ;
}
@ -173,5 +230,13 @@ function handleExport() {
} , ` post_ ${ new Date ( ) . getTime ( ) } .xlsx ` ) ;
}
getList ( ) ;
/ / g e t L i s t ( ) ;
< / script >
< style >
. myChart {
width : 100 % ;
height : 300 px ;
}
< / style >