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

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

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

Loading…
Cancel
Save