|
|
|
@ -131,37 +131,29 @@
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="historyData"
|
|
|
|
|
v-if="isHistoryTable"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="index"
|
|
|
|
|
width="50">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="longitude"
|
|
|
|
|
label="经度"
|
|
|
|
|
v-for="i in Object.keys(historyTh)"
|
|
|
|
|
v-if="historyTh[i]"
|
|
|
|
|
:prop="i"
|
|
|
|
|
:label="historyTh[i]"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="latitude"
|
|
|
|
|
label="纬度"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="speed"
|
|
|
|
|
label="速度">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="ts"
|
|
|
|
|
label="采集时间">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<pagination
|
|
|
|
|
v-if="isHistoryTable"
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="form.pageNum"
|
|
|
|
|
:limit.sync="form.pageSize"
|
|
|
|
|
@pagination="getHistoryData"
|
|
|
|
|
/>
|
|
|
|
|
<Chart v-if="!isHistoryTable" ref="historyChart" class="historyChart"></Chart>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog title="对比" :visible.sync="comparisonDialog">
|
|
|
|
@ -193,47 +185,9 @@
|
|
|
|
|
<el-button type="primary" @click="getComparisonData">查询</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- <div style="margin-bottom: 12px">-->
|
|
|
|
|
<!-- <el-button type="primary">导出</el-button>-->
|
|
|
|
|
<!-- <el-button type="success">对比</el-button>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<el-table
|
|
|
|
|
v-if="false"
|
|
|
|
|
:data="historyData"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column
|
|
|
|
|
type="index"
|
|
|
|
|
width="50">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="longitude"
|
|
|
|
|
label="经度"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="latitude"
|
|
|
|
|
label="纬度"
|
|
|
|
|
width="180">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="speed"
|
|
|
|
|
label="速度">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
prop="ts"
|
|
|
|
|
label="采集时间">
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div>
|
|
|
|
|
<Chart ref="chart" class="chart"></Chart>
|
|
|
|
|
</div>
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="form.pageNum"
|
|
|
|
|
:limit.sync="form.pageSize"
|
|
|
|
|
@pagination="getHistoryData"
|
|
|
|
|
/>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -296,6 +250,8 @@ export default {
|
|
|
|
|
time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()],
|
|
|
|
|
},
|
|
|
|
|
historyData: [],
|
|
|
|
|
historyTh:{},
|
|
|
|
|
isHistoryTable:true,
|
|
|
|
|
total: 100,
|
|
|
|
|
comparisonDialog: false,
|
|
|
|
|
sensorOptions: [],
|
|
|
|
@ -392,8 +348,6 @@ export default {
|
|
|
|
|
this.MonitorInfo = data
|
|
|
|
|
},
|
|
|
|
|
toHistory(e, i) {
|
|
|
|
|
// console.log(e)
|
|
|
|
|
// console.log(i)
|
|
|
|
|
// this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
|
|
|
|
|
this.historyDialog = true
|
|
|
|
|
this.form = {
|
|
|
|
@ -411,8 +365,50 @@ export default {
|
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
|
delete query.time
|
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
|
this.historyData = data.rows
|
|
|
|
|
this.total = data.total
|
|
|
|
|
if(query.type === '1'){
|
|
|
|
|
|
|
|
|
|
this.isHistoryTable = false
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
let series = Object.keys(data.mapName).map(e => {
|
|
|
|
|
if(data.mapName[e]){
|
|
|
|
|
return {
|
|
|
|
|
name: data.mapName[e],
|
|
|
|
|
type: 'line',
|
|
|
|
|
stack: 'Total',
|
|
|
|
|
data: data.tableDataInfo.rows.map(v=>[new Date(v.ts),v[e]])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.$refs.historyChart.setData({
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis'
|
|
|
|
|
},
|
|
|
|
|
legend: {},
|
|
|
|
|
grid: {
|
|
|
|
|
left: '3%',
|
|
|
|
|
right: '4%',
|
|
|
|
|
bottom: '3%',
|
|
|
|
|
containLabel: true
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'time',
|
|
|
|
|
boundaryGap: false,
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'value'
|
|
|
|
|
},
|
|
|
|
|
series: series
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if(query.type === '2'){
|
|
|
|
|
this.isHistoryTable = true
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
this.historyData = data.tableDataInfo.rows
|
|
|
|
|
this.historyTh = data.mapName
|
|
|
|
|
this.total = data.tableDataInfo.total
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async comparison() {
|
|
|
|
|
this.comparisonDialog = true
|
|
|
|
@ -458,7 +454,7 @@ export default {
|
|
|
|
|
delete query.sensor
|
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
|
let chartData = {}
|
|
|
|
|
data.rows.forEach(e => {
|
|
|
|
|
data.tableDataInfo.rows.forEach(e => {
|
|
|
|
|
if (chartData[e.deviceId]) {
|
|
|
|
|
chartData[e.deviceId].push({
|
|
|
|
|
value: [new Date(e.ts), e.functionIdentifier]
|
|
|
|
@ -508,7 +504,6 @@ export default {
|
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
|
delete query.time
|
|
|
|
|
const data = exportData(query, '历史数据')
|
|
|
|
|
console.log(data)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
@ -811,4 +806,8 @@ export default {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 50vh;
|
|
|
|
|
}
|
|
|
|
|
.historyChart{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 50vh;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|