master
夜笙歌 1 year ago
parent 331c9b004a
commit 52860e4c03

@ -118,8 +118,7 @@ console.log(echarts)
function getList() {
loading.value = true;
listTest(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
postList.value = response.rows;
total.value = response.total;
postList.value = response;
let chart = echarts.init(document.getElementById('myChart'))
chart.setOption({
@ -145,7 +144,7 @@ function getList() {
xAxis: [
{
type: "category",
data: response.rows.map(e => e.createTime),
data: response.map(e => e.createTime),
axisLine: {
lineStyle: {
color: "#DCE2E8",
@ -176,7 +175,7 @@ function getList() {
{
name: "海拔",
type: "line",
data: response.rows.map(e => e.altitude || 0),
data: response.map(e => e.altitude || 0),
symbolSize: 1,
symbol: "circle",
smooth: true,
@ -191,7 +190,7 @@ function getList() {
{
name: "速度",
type: "line",
data: response.rows.map(e => e.speed || 0),
data: response.map(e => e.speed || 0),
symbolSize: 1,
yAxisIndex: 1,
symbol: "circle",

@ -1,5 +1,5 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
<div :class="className" :style="{height:height,width:width}"/>
</template>
<script>
@ -30,9 +30,9 @@ export default {
data() {
return {
chart: null,
XData:['高温报警', '低压报警', '电池电量报警', '位置报警'],
dataOne:[1,2,3],
dataTwo:[3,4,5]
XData: ['高温报警', '低压报警', '电池电量报警', '位置报警'],
dataOne: [1, 2, 3],
dataTwo: [3, 4, 5]
}
},
mounted() {
@ -50,7 +50,7 @@ export default {
methods: {
setData(e) {
console.log(e)
let item = e.filter(val => !!val )
let item = e.filter(val => !!val)
this.XData = item.map(val => val.time || '')
this.dataOne = item.map(val => val.course)
this.dataTwo = item.map(val => val.textureDepth)
@ -78,10 +78,10 @@ export default {
},
toolbox: {
feature: {
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar'] },
restore: { show: true },
saveAsImage: { show: true }
dataView: {show: true, readOnly: false},
magicType: {show: true, type: ['line', 'bar']},
restore: {show: true},
saveAsImage: {show: true}
}
},
legend: {

Loading…
Cancel
Save