|
|
@ -131,37 +131,29 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
:data="historyData"
|
|
|
|
:data="historyData"
|
|
|
|
|
|
|
|
v-if="isHistoryTable"
|
|
|
|
style="width: 100%">
|
|
|
|
style="width: 100%">
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
type="index"
|
|
|
|
type="index"
|
|
|
|
width="50">
|
|
|
|
width="50">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
prop="longitude"
|
|
|
|
v-for="i in Object.keys(historyTh)"
|
|
|
|
label="经度"
|
|
|
|
v-if="historyTh[i]"
|
|
|
|
|
|
|
|
:prop="i"
|
|
|
|
|
|
|
|
:label="historyTh[i]"
|
|
|
|
width="180">
|
|
|
|
width="180">
|
|
|
|
</el-table-column>
|
|
|
|
</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>
|
|
|
|
</el-table>
|
|
|
|
<pagination
|
|
|
|
<pagination
|
|
|
|
|
|
|
|
v-if="isHistoryTable"
|
|
|
|
v-show="total>0"
|
|
|
|
v-show="total>0"
|
|
|
|
:total="total"
|
|
|
|
:total="total"
|
|
|
|
:page.sync="form.pageNum"
|
|
|
|
:page.sync="form.pageNum"
|
|
|
|
:limit.sync="form.pageSize"
|
|
|
|
:limit.sync="form.pageSize"
|
|
|
|
@pagination="getHistoryData"
|
|
|
|
@pagination="getHistoryData"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Chart v-if="!isHistoryTable" ref="historyChart" class="historyChart"></Chart>
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="对比" :visible.sync="comparisonDialog">
|
|
|
|
<el-dialog title="对比" :visible.sync="comparisonDialog">
|
|
|
@ -193,47 +185,9 @@
|
|
|
|
<el-button type="primary" @click="getComparisonData">查询</el-button>
|
|
|
|
<el-button type="primary" @click="getComparisonData">查询</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</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>
|
|
|
|
<div>
|
|
|
|
<Chart ref="chart" class="chart"></Chart>
|
|
|
|
<Chart ref="chart" class="chart"></Chart>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<pagination
|
|
|
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
|
|
:page.sync="form.pageNum"
|
|
|
|
|
|
|
|
:limit.sync="form.pageSize"
|
|
|
|
|
|
|
|
@pagination="getHistoryData"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
</el-dialog>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -296,6 +250,8 @@ export default {
|
|
|
|
time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()],
|
|
|
|
time: [new Date(new Date().getTime() - 1000 * 60 * 60 * 24), new Date()],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
historyData: [],
|
|
|
|
historyData: [],
|
|
|
|
|
|
|
|
historyTh:{},
|
|
|
|
|
|
|
|
isHistoryTable:true,
|
|
|
|
total: 100,
|
|
|
|
total: 100,
|
|
|
|
comparisonDialog: false,
|
|
|
|
comparisonDialog: false,
|
|
|
|
sensorOptions: [],
|
|
|
|
sensorOptions: [],
|
|
|
@ -392,8 +348,6 @@ export default {
|
|
|
|
this.MonitorInfo = data
|
|
|
|
this.MonitorInfo = data
|
|
|
|
},
|
|
|
|
},
|
|
|
|
toHistory(e, i) {
|
|
|
|
toHistory(e, i) {
|
|
|
|
// console.log(e)
|
|
|
|
|
|
|
|
// console.log(i)
|
|
|
|
|
|
|
|
// this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
|
|
|
|
// this.$router.push({path: "/board/senso", query: {id: e, deviceModeId: i}});
|
|
|
|
this.historyDialog = true
|
|
|
|
this.historyDialog = true
|
|
|
|
this.form = {
|
|
|
|
this.form = {
|
|
|
@ -411,8 +365,50 @@ export default {
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
delete query.time
|
|
|
|
delete query.time
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
this.historyData = data.rows
|
|
|
|
if(query.type === '1'){
|
|
|
|
this.total = data.total
|
|
|
|
|
|
|
|
|
|
|
|
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() {
|
|
|
|
async comparison() {
|
|
|
|
this.comparisonDialog = true
|
|
|
|
this.comparisonDialog = true
|
|
|
@ -458,7 +454,7 @@ export default {
|
|
|
|
delete query.sensor
|
|
|
|
delete query.sensor
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
const data = await selectHistoryAndTrendAnalysis(query)
|
|
|
|
let chartData = {}
|
|
|
|
let chartData = {}
|
|
|
|
data.rows.forEach(e => {
|
|
|
|
data.tableDataInfo.rows.forEach(e => {
|
|
|
|
if (chartData[e.deviceId]) {
|
|
|
|
if (chartData[e.deviceId]) {
|
|
|
|
chartData[e.deviceId].push({
|
|
|
|
chartData[e.deviceId].push({
|
|
|
|
value: [new Date(e.ts), e.functionIdentifier]
|
|
|
|
value: [new Date(e.ts), e.functionIdentifier]
|
|
|
@ -508,7 +504,6 @@ export default {
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
query.endTime = this.parseTime(this.form.time?.[1]?.getTime())
|
|
|
|
delete query.time
|
|
|
|
delete query.time
|
|
|
|
const data = exportData(query, '历史数据')
|
|
|
|
const data = exportData(query, '历史数据')
|
|
|
|
console.log(data)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -811,4 +806,8 @@ export default {
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
height: 50vh;
|
|
|
|
height: 50vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.historyChart{
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
height: 50vh;
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|